From d4636472af13dc1bc8477f7b1a68f85b45bbfcfd Mon Sep 17 00:00:00 2001 From: Magnus Markling Date: Sun, 6 Oct 2024 20:34:34 +0200 Subject: [PATCH] Use `React.JSX` instead of `JSX` --- .../src/components/button/button.tsx | 2 +- .../src/components/checkbox/checkbox.tsx | 2 +- .../src/components/combobox/combobox.tsx | 10 +++++----- .../data-interactive/data-interactive.tsx | 2 +- .../src/components/description/description.tsx | 4 ++-- .../src/components/dialog/dialog.tsx | 8 ++++---- .../src/components/disclosure/disclosure.tsx | 6 +++--- .../src/components/field/field.tsx | 2 +- .../src/components/fieldset/fieldset.tsx | 4 +++- .../src/components/focus-trap/focus-trap.tsx | 2 +- .../src/components/input/input.tsx | 2 +- .../src/components/label/label.tsx | 4 ++-- .../src/components/legend/legend.tsx | 4 +++- .../src/components/listbox/listbox.tsx | 10 +++++----- .../@headlessui-react/src/components/menu/menu.tsx | 14 +++++++------- .../src/components/popover/popover.tsx | 10 +++++----- .../src/components/portal/portal.tsx | 4 ++-- .../src/components/radio-group/radio-group.tsx | 6 +++--- .../src/components/select/select.tsx | 2 +- .../src/components/switch/switch.tsx | 4 ++-- .../@headlessui-react/src/components/tabs/tabs.tsx | 10 +++++----- .../src/components/textarea/textarea.tsx | 2 +- .../src/components/tooltip/tooltip.tsx | 6 +++--- .../src/components/transition/transition.tsx | 4 ++-- packages/@headlessui-react/src/internal/hidden.tsx | 2 +- .../src/test-utils/execute-timeline.ts | 2 +- packages/@headlessui-react/src/types.ts | 2 +- .../@headlessui-react/src/utils/render.test.tsx | 4 ++-- playgrounds/react/pages/suspense/portal.tsx | 2 +- 29 files changed, 70 insertions(+), 66 deletions(-) diff --git a/packages/@headlessui-react/src/components/button/button.tsx b/packages/@headlessui-react/src/components/button/button.tsx index 96310a8ff0..174b6a503e 100644 --- a/packages/@headlessui-react/src/components/button/button.tsx +++ b/packages/@headlessui-react/src/components/button/button.tsx @@ -78,7 +78,7 @@ function ButtonFn( export interface _internal_ComponentButton extends HasDisplayName { ( props: ButtonProps & RefProp - ): JSX.Element + ): React.JSX.Element } export let Button = forwardRefWithAs(ButtonFn) as _internal_ComponentButton diff --git a/packages/@headlessui-react/src/components/checkbox/checkbox.tsx b/packages/@headlessui-react/src/components/checkbox/checkbox.tsx index a30415ed8f..f68ed348fd 100644 --- a/packages/@headlessui-react/src/components/checkbox/checkbox.tsx +++ b/packages/@headlessui-react/src/components/checkbox/checkbox.tsx @@ -203,7 +203,7 @@ function CheckboxFn( props: CheckboxProps & RefProp - ): JSX.Element + ): React.JSX.Element } export let Checkbox = forwardRefWithAs(CheckboxFn) as _internal_ComponentCheckbox diff --git a/packages/@headlessui-react/src/components/combobox/combobox.tsx b/packages/@headlessui-react/src/components/combobox/combobox.tsx index 439d92bed1..b6ab9e1711 100644 --- a/packages/@headlessui-react/src/components/combobox/combobox.tsx +++ b/packages/@headlessui-react/src/components/combobox/combobox.tsx @@ -2055,19 +2055,19 @@ export interface _internal_ComponentCombobox extends HasDisplayName { TTag extends ElementType = typeof DEFAULT_COMBOBOX_TAG, >( props: ComboboxProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentComboboxButton extends HasDisplayName { ( props: ComboboxButtonProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentComboboxInput extends HasDisplayName { ( props: ComboboxInputProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentComboboxLabel extends _internal_ComponentLabel {} @@ -2075,7 +2075,7 @@ export interface _internal_ComponentComboboxLabel extends _internal_ComponentLab export interface _internal_ComponentComboboxOptions extends HasDisplayName { ( props: ComboboxOptionsProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentComboboxOption extends HasDisplayName { @@ -2084,7 +2084,7 @@ export interface _internal_ComponentComboboxOption extends HasDisplayName { TType = Parameters[0]['value'], >( props: ComboboxOptionProps & RefProp - ): JSX.Element + ): React.JSX.Element } let ComboboxRoot = forwardRefWithAs(ComboboxFn) as _internal_ComponentCombobox diff --git a/packages/@headlessui-react/src/components/data-interactive/data-interactive.tsx b/packages/@headlessui-react/src/components/data-interactive/data-interactive.tsx index 9f5b7deae8..b85eb113db 100644 --- a/packages/@headlessui-react/src/components/data-interactive/data-interactive.tsx +++ b/packages/@headlessui-react/src/components/data-interactive/data-interactive.tsx @@ -59,7 +59,7 @@ function DataInteractiveFn( props: DataInteractiveProps & RefProp - ): JSX.Element + ): React.JSX.Element } export let DataInteractive = forwardRefWithAs( diff --git a/packages/@headlessui-react/src/components/description/description.tsx b/packages/@headlessui-react/src/components/description/description.tsx index d5d1bd6c6d..d9a243d081 100644 --- a/packages/@headlessui-react/src/components/description/description.tsx +++ b/packages/@headlessui-react/src/components/description/description.tsx @@ -53,7 +53,7 @@ interface DescriptionProviderProps extends SharedData { export function useDescriptions(): [ string | undefined, - (props: DescriptionProviderProps) => JSX.Element, + (props: DescriptionProviderProps) => React.JSX.Element, ] { let [descriptionIds, setDescriptionIds] = useState([]) @@ -134,7 +134,7 @@ function DescriptionFn( props: DescriptionProps & RefProp - ): JSX.Element + ): React.JSX.Element } let DescriptionRoot = forwardRefWithAs(DescriptionFn) as _internal_ComponentDescription diff --git a/packages/@headlessui-react/src/components/dialog/dialog.tsx b/packages/@headlessui-react/src/components/dialog/dialog.tsx index c1687675a5..f4e965b833 100644 --- a/packages/@headlessui-react/src/components/dialog/dialog.tsx +++ b/packages/@headlessui-react/src/components/dialog/dialog.tsx @@ -555,25 +555,25 @@ function TitleFn( export interface _internal_ComponentDialog extends HasDisplayName { ( props: DialogProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentDialogPanel extends HasDisplayName { ( props: DialogPanelProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentDialogBackdrop extends HasDisplayName { ( props: DialogBackdropProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentDialogTitle extends HasDisplayName { ( props: DialogTitleProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentDialogDescription extends _internal_ComponentDescription {} diff --git a/packages/@headlessui-react/src/components/disclosure/disclosure.tsx b/packages/@headlessui-react/src/components/disclosure/disclosure.tsx index b139d35650..1ae9684649 100644 --- a/packages/@headlessui-react/src/components/disclosure/disclosure.tsx +++ b/packages/@headlessui-react/src/components/disclosure/disclosure.tsx @@ -519,19 +519,19 @@ function PanelFn( export interface _internal_ComponentDisclosure extends HasDisplayName { ( props: DisclosureProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentDisclosureButton extends HasDisplayName { ( props: DisclosureButtonProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentDisclosurePanel extends HasDisplayName { ( props: DisclosurePanelProps & RefProp - ): JSX.Element + ): React.JSX.Element } let DisclosureRoot = forwardRefWithAs(DisclosureFn) as _internal_ComponentDisclosure diff --git a/packages/@headlessui-react/src/components/field/field.tsx b/packages/@headlessui-react/src/components/field/field.tsx index a4d6812805..27d9ae154d 100644 --- a/packages/@headlessui-react/src/components/field/field.tsx +++ b/packages/@headlessui-react/src/components/field/field.tsx @@ -73,7 +73,7 @@ function FieldFn( } export interface _internal_ComponentField extends HasDisplayName { - (props: FieldProps): JSX.Element + (props: FieldProps): React.JSX.Element } export let Field = forwardRefWithAs(FieldFn) as _internal_ComponentField diff --git a/packages/@headlessui-react/src/components/fieldset/fieldset.tsx b/packages/@headlessui-react/src/components/fieldset/fieldset.tsx index e23b1572c4..ae8a1eab20 100644 --- a/packages/@headlessui-react/src/components/fieldset/fieldset.tsx +++ b/packages/@headlessui-react/src/components/fieldset/fieldset.tsx @@ -66,7 +66,9 @@ function FieldsetFn( } export interface _internal_ComponentFieldset extends HasDisplayName { - (props: FieldsetProps): JSX.Element + ( + props: FieldsetProps + ): React.JSX.Element } export let Fieldset = forwardRefWithAs(FieldsetFn) as _internal_ComponentFieldset diff --git a/packages/@headlessui-react/src/components/focus-trap/focus-trap.tsx b/packages/@headlessui-react/src/components/focus-trap/focus-trap.tsx index 00b775ad29..6ee1a539d4 100644 --- a/packages/@headlessui-react/src/components/focus-trap/focus-trap.tsx +++ b/packages/@headlessui-react/src/components/focus-trap/focus-trap.tsx @@ -232,7 +232,7 @@ function FocusTrapFn( export interface _internal_ComponentFocusTrap extends HasDisplayName { ( props: FocusTrapProps & RefProp - ): JSX.Element + ): React.JSX.Element } let FocusTrapRoot = forwardRefWithAs(FocusTrapFn) as _internal_ComponentFocusTrap diff --git a/packages/@headlessui-react/src/components/input/input.tsx b/packages/@headlessui-react/src/components/input/input.tsx index c17409f508..212465ee33 100644 --- a/packages/@headlessui-react/src/components/input/input.tsx +++ b/packages/@headlessui-react/src/components/input/input.tsx @@ -90,7 +90,7 @@ function InputFn( export interface _internal_ComponentInput extends HasDisplayName { ( props: InputProps & RefProp - ): JSX.Element + ): React.JSX.Element } export let Input = forwardRefWithAs(InputFn) as _internal_ComponentInput diff --git a/packages/@headlessui-react/src/components/label/label.tsx b/packages/@headlessui-react/src/components/label/label.tsx index d65ae032f6..73c7c96b39 100644 --- a/packages/@headlessui-react/src/components/label/label.tsx +++ b/packages/@headlessui-react/src/components/label/label.tsx @@ -57,7 +57,7 @@ interface LabelProviderProps extends SharedData { export function useLabels({ inherit = false } = {}): [ string | undefined, - (props: LabelProviderProps & { inherit?: boolean }) => JSX.Element, + (props: LabelProviderProps & { inherit?: boolean }) => React.JSX.Element, ] { let parentLabelledBy = useLabelledBy() let [labelIds, setLabelIds] = useState([]) @@ -217,7 +217,7 @@ function LabelFn( export interface _internal_ComponentLabel extends HasDisplayName { ( props: LabelProps & RefProp - ): JSX.Element + ): React.JSX.Element } let LabelRoot = forwardRefWithAs(LabelFn) as _internal_ComponentLabel diff --git a/packages/@headlessui-react/src/components/legend/legend.tsx b/packages/@headlessui-react/src/components/legend/legend.tsx index 12c27c7499..dbde385d64 100644 --- a/packages/@headlessui-react/src/components/legend/legend.tsx +++ b/packages/@headlessui-react/src/components/legend/legend.tsx @@ -28,7 +28,9 @@ function LegendFn( } export interface _internal_ComponentLegend extends HasDisplayName { - (props: LegendProps): JSX.Element + ( + props: LegendProps + ): React.JSX.Element } export let Legend = forwardRefWithAs(LegendFn) as _internal_ComponentLegend diff --git a/packages/@headlessui-react/src/components/listbox/listbox.tsx b/packages/@headlessui-react/src/components/listbox/listbox.tsx index e9a8150a57..7fc4e4a01d 100644 --- a/packages/@headlessui-react/src/components/listbox/listbox.tsx +++ b/packages/@headlessui-react/src/components/listbox/listbox.tsx @@ -1408,13 +1408,13 @@ export interface _internal_ComponentListbox extends HasDisplayName { TActualType = TType extends (infer U)[] ? U : TType, >( props: ListboxProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentListboxButton extends HasDisplayName { ( props: ListboxButtonProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentListboxLabel extends _internal_ComponentLabel {} @@ -1422,7 +1422,7 @@ export interface _internal_ComponentListboxLabel extends _internal_ComponentLabe export interface _internal_ComponentListboxOptions extends HasDisplayName { ( props: ListboxOptionsProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentListboxOption extends HasDisplayName { @@ -1431,13 +1431,13 @@ export interface _internal_ComponentListboxOption extends HasDisplayName { TType = Parameters[0]['value'], >( props: ListboxOptionProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentListboxSelectedOption extends HasDisplayName { ( props: ListboxSelectedOptionProps & RefProp - ): JSX.Element + ): React.JSX.Element } let ListboxRoot = forwardRefWithAs(ListboxFn) as _internal_ComponentListbox diff --git a/packages/@headlessui-react/src/components/menu/menu.tsx b/packages/@headlessui-react/src/components/menu/menu.tsx index 57a823eb09..251cc021ae 100644 --- a/packages/@headlessui-react/src/components/menu/menu.tsx +++ b/packages/@headlessui-react/src/components/menu/menu.tsx @@ -1097,43 +1097,43 @@ function SeparatorFn( export interface _internal_ComponentMenu extends HasDisplayName { ( props: MenuProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentMenuButton extends HasDisplayName { ( props: MenuButtonProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentMenuItems extends HasDisplayName { ( props: MenuItemsProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentMenuItem extends HasDisplayName { ( props: MenuItemProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentMenuSection extends HasDisplayName { ( props: MenuSectionProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentMenuHeading extends HasDisplayName { ( props: MenuHeadingProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentMenuSeparator extends HasDisplayName { ( props: MenuSeparatorProps & RefProp - ): JSX.Element + ): React.JSX.Element } let MenuRoot = forwardRefWithAs(MenuFn) as _internal_ComponentMenu diff --git a/packages/@headlessui-react/src/components/popover/popover.tsx b/packages/@headlessui-react/src/components/popover/popover.tsx index 74526e17cc..386ec35794 100644 --- a/packages/@headlessui-react/src/components/popover/popover.tsx +++ b/packages/@headlessui-react/src/components/popover/popover.tsx @@ -1208,31 +1208,31 @@ function GroupFn( export interface _internal_ComponentPopover extends HasDisplayName { ( props: PopoverProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentPopoverButton extends HasDisplayName { ( props: PopoverButtonProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentPopoverBackdrop extends HasDisplayName { ( props: PopoverBackdropProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentPopoverPanel extends HasDisplayName { ( props: PopoverPanelProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentPopoverGroup extends HasDisplayName { ( props: PopoverGroupProps & RefProp - ): JSX.Element + ): React.JSX.Element } let PopoverRoot = forwardRefWithAs(PopoverFn) as _internal_ComponentPopover diff --git a/packages/@headlessui-react/src/components/portal/portal.tsx b/packages/@headlessui-react/src/components/portal/portal.tsx index 8de48410cd..efc0cba2f8 100644 --- a/packages/@headlessui-react/src/components/portal/portal.tsx +++ b/packages/@headlessui-react/src/components/portal/portal.tsx @@ -249,13 +249,13 @@ export function useNestedPortals() { export interface _internal_ComponentPortal extends HasDisplayName { ( props: PortalProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentPortalGroup extends HasDisplayName { ( props: PortalGroupProps & RefProp - ): JSX.Element + ): React.JSX.Element } let PortalRoot = forwardRefWithAs(PortalFn) as unknown as _internal_ComponentPortal diff --git a/packages/@headlessui-react/src/components/radio-group/radio-group.tsx b/packages/@headlessui-react/src/components/radio-group/radio-group.tsx index 7c2130a803..bfeaee8033 100644 --- a/packages/@headlessui-react/src/components/radio-group/radio-group.tsx +++ b/packages/@headlessui-react/src/components/radio-group/radio-group.tsx @@ -571,19 +571,19 @@ function RadioFn< export interface _internal_ComponentRadioGroup extends HasDisplayName { ( props: RadioGroupProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentRadioOption extends HasDisplayName { ( props: RadioOptionProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentRadio extends HasDisplayName { ( props: RadioProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentRadioLabel extends _internal_ComponentLabel {} diff --git a/packages/@headlessui-react/src/components/select/select.tsx b/packages/@headlessui-react/src/components/select/select.tsx index 9115794163..afcc900fa2 100644 --- a/packages/@headlessui-react/src/components/select/select.tsx +++ b/packages/@headlessui-react/src/components/select/select.tsx @@ -101,7 +101,7 @@ function SelectFn( export interface _internal_ComponentSelect extends HasDisplayName { ( props: SelectProps & RefProp - ): JSX.Element + ): React.JSX.Element } export let Select = forwardRefWithAs(SelectFn) as _internal_ComponentSelect diff --git a/packages/@headlessui-react/src/components/switch/switch.tsx b/packages/@headlessui-react/src/components/switch/switch.tsx index f0f64bdb6e..989fe817f3 100644 --- a/packages/@headlessui-react/src/components/switch/switch.tsx +++ b/packages/@headlessui-react/src/components/switch/switch.tsx @@ -265,13 +265,13 @@ function SwitchFn( export interface _internal_ComponentSwitch extends HasDisplayName { ( props: SwitchProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentSwitchGroup extends HasDisplayName { ( props: SwitchGroupProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentSwitchLabel extends _internal_ComponentLabel {} diff --git a/packages/@headlessui-react/src/components/tabs/tabs.tsx b/packages/@headlessui-react/src/components/tabs/tabs.tsx index 9969273f47..52c925212c 100644 --- a/packages/@headlessui-react/src/components/tabs/tabs.tsx +++ b/packages/@headlessui-react/src/components/tabs/tabs.tsx @@ -670,31 +670,31 @@ function PanelFn( export interface _internal_ComponentTab extends HasDisplayName { ( props: TabProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentTabGroup extends HasDisplayName { ( props: TabGroupProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentTabList extends HasDisplayName { ( props: TabListProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentTabPanels extends HasDisplayName { ( props: TabPanelsProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentTabPanel extends HasDisplayName { ( props: TabPanelProps & RefProp - ): JSX.Element + ): React.JSX.Element } let TabRoot = forwardRefWithAs(TabFn) as _internal_ComponentTab diff --git a/packages/@headlessui-react/src/components/textarea/textarea.tsx b/packages/@headlessui-react/src/components/textarea/textarea.tsx index 67cd3631c4..b32cfcd1b7 100644 --- a/packages/@headlessui-react/src/components/textarea/textarea.tsx +++ b/packages/@headlessui-react/src/components/textarea/textarea.tsx @@ -90,7 +90,7 @@ function TextareaFn( export interface _internal_ComponentTextarea extends HasDisplayName { ( props: TextareaProps & RefProp - ): JSX.Element + ): React.JSX.Element } export let Textarea = forwardRefWithAs(TextareaFn) as _internal_ComponentTextarea diff --git a/packages/@headlessui-react/src/components/tooltip/tooltip.tsx b/packages/@headlessui-react/src/components/tooltip/tooltip.tsx index 2a06f99979..03ddacfb61 100644 --- a/packages/@headlessui-react/src/components/tooltip/tooltip.tsx +++ b/packages/@headlessui-react/src/components/tooltip/tooltip.tsx @@ -473,19 +473,19 @@ function PanelFn( export interface _internal_ComponentTooltip extends HasDisplayName { ( props: TooltipProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentTrigger extends HasDisplayName { ( props: TooltipTriggerProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentPanel extends HasDisplayName { ( props: TooltipPanelProps & RefProp - ): JSX.Element + ): React.JSX.Element } export let Tooltip = forwardRefWithAs(TooltipFn) as _internal_ComponentTooltip diff --git a/packages/@headlessui-react/src/components/transition/transition.tsx b/packages/@headlessui-react/src/components/transition/transition.tsx index 9f0922f0a3..efe0ad81c8 100644 --- a/packages/@headlessui-react/src/components/transition/transition.tsx +++ b/packages/@headlessui-react/src/components/transition/transition.tsx @@ -620,13 +620,13 @@ function ChildFn export interface _internal_ComponentTransitionRoot extends HasDisplayName { ( props: TransitionRootProps & RefProp - ): JSX.Element + ): React.JSX.Element } export interface _internal_ComponentTransitionChild extends HasDisplayName { ( props: TransitionChildProps & RefProp - ): JSX.Element + ): React.JSX.Element } let TransitionRoot = forwardRefWithAs(TransitionRootFn) as _internal_ComponentTransitionRoot diff --git a/packages/@headlessui-react/src/internal/hidden.tsx b/packages/@headlessui-react/src/internal/hidden.tsx index 04b13b26bf..e8e5b0e2a5 100644 --- a/packages/@headlessui-react/src/internal/hidden.tsx +++ b/packages/@headlessui-react/src/internal/hidden.tsx @@ -67,7 +67,7 @@ function VisuallyHidden( props: HiddenProps & RefProp - ): JSX.Element + ): React.JSX.Element } export let Hidden = forwardRefWithAs(VisuallyHidden) as ComponentHidden diff --git a/packages/@headlessui-react/src/test-utils/execute-timeline.ts b/packages/@headlessui-react/src/test-utils/execute-timeline.ts index 106a886b89..b2bf7b7beb 100644 --- a/packages/@headlessui-react/src/test-utils/execute-timeline.ts +++ b/packages/@headlessui-react/src/test-utils/execute-timeline.ts @@ -23,7 +23,7 @@ function redentSnapshot(input: string) { } export async function executeTimeline( - element: JSX.Element, + element: React.JSX.Element, steps: ((tools: ReturnType) => (null | number)[])[] ) { let d = disposables() diff --git a/packages/@headlessui-react/src/types.ts b/packages/@headlessui-react/src/types.ts index 8bf566b4e4..a6bd6d704d 100644 --- a/packages/@headlessui-react/src/types.ts +++ b/packages/@headlessui-react/src/types.ts @@ -1,6 +1,6 @@ import type { JSXElementConstructor, ReactElement, ReactNode } from 'react' -export type ReactTag = keyof JSX.IntrinsicElements | JSXElementConstructor +export type ReactTag = keyof React.JSX.IntrinsicElements | JSXElementConstructor export type Expand = T extends infer O ? { [K in keyof O]: O[K] } : never diff --git a/packages/@headlessui-react/src/utils/render.test.tsx b/packages/@headlessui-react/src/utils/render.test.tsx index c1ede8354f..1d785b0dde 100644 --- a/packages/@headlessui-react/src/utils/render.test.tsx +++ b/packages/@headlessui-react/src/utils/render.test.tsx @@ -272,7 +272,7 @@ describe('Default functionality', () => { // --- -function testStaticFeature(Dummy: (props: any) => JSX.Element) { +function testStaticFeature(Dummy: (props: any) => React.JSX.Element) { it('should be possible to render a `static` dummy component (show = true)', () => { testRender( @@ -325,7 +325,7 @@ describe('Features.Static', () => { // --- -function testRenderStrategyFeature(Dummy: (props: any) => JSX.Element) { +function testRenderStrategyFeature(Dummy: (props: any) => React.JSX.Element) { describe('Unmount render strategy', () => { it('should be possible to render an `unmount` dummy component (show = true)', () => { testRender( diff --git a/playgrounds/react/pages/suspense/portal.tsx b/playgrounds/react/pages/suspense/portal.tsx index f2ef15b865..f82b3ef77f 100644 --- a/playgrounds/react/pages/suspense/portal.tsx +++ b/playgrounds/react/pages/suspense/portal.tsx @@ -3,7 +3,7 @@ import { Portal } from '@headlessui/react' import { lazy, Suspense } from 'react' -function MyComponent({ children }: { children(message: string): JSX.Element }) { +function MyComponent({ children }: { children(message: string): React.JSX.Element }) { return <>{children('test')} }