diff --git a/packages/@headlessui-react/CHANGELOG.md b/packages/@headlessui-react/CHANGELOG.md index b0bb4c4565..46e0cd8b4d 100644 --- a/packages/@headlessui-react/CHANGELOG.md +++ b/packages/@headlessui-react/CHANGELOG.md @@ -16,7 +16,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix SSR tab hydration when using Strict Mode in development ([#2231](https://github.com/tailwindlabs/headlessui/pull/2231)) - Don't break overflow when multiple dialogs are open at the same time ([#2215](https://github.com/tailwindlabs/headlessui/pull/2215)) - Fix "This `Suspense` boundary received an update before it finished hydrating" error in the `Disclosure` component ([#2238](https://github.com/tailwindlabs/headlessui/pull/2238)) -- Use the `import * as React from 'react'` pattern ([#2242](https://github.com/tailwindlabs/headlessui/pull/2242)) ## [1.7.8] - 2023-01-27 diff --git a/packages/@headlessui-react/src/components/combobox/combobox.tsx b/packages/@headlessui-react/src/components/combobox/combobox.tsx index 765c822cdd..256b4087c4 100644 --- a/packages/@headlessui-react/src/components/combobox/combobox.tsx +++ b/packages/@headlessui-react/src/components/combobox/combobox.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { Fragment, createContext, createRef, diff --git a/packages/@headlessui-react/src/components/description/description.tsx b/packages/@headlessui-react/src/components/description/description.tsx index 8500295350..1924fbabc3 100644 --- a/packages/@headlessui-react/src/components/description/description.tsx +++ b/packages/@headlessui-react/src/components/description/description.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { createContext, useContext, useMemo, diff --git a/packages/@headlessui-react/src/components/dialog/dialog.tsx b/packages/@headlessui-react/src/components/dialog/dialog.tsx index 84bb48e7e5..bb83b30ed9 100644 --- a/packages/@headlessui-react/src/components/dialog/dialog.tsx +++ b/packages/@headlessui-react/src/components/dialog/dialog.tsx @@ -1,6 +1,5 @@ // WAI-ARIA: https://www.w3.org/WAI/ARIA/apg/patterns/dialogmodal/ -import * as React from 'react' -import { +import React, { createContext, createRef, useContext, diff --git a/packages/@headlessui-react/src/components/disclosure/disclosure.tsx b/packages/@headlessui-react/src/components/disclosure/disclosure.tsx index 911ee7373e..d62a91caef 100644 --- a/packages/@headlessui-react/src/components/disclosure/disclosure.tsx +++ b/packages/@headlessui-react/src/components/disclosure/disclosure.tsx @@ -1,6 +1,5 @@ // WAI-ARIA: https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/ -import * as React from 'react' -import { +import React, { Fragment, createContext, useContext, 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 71777b60e1..df13b4312a 100644 --- a/packages/@headlessui-react/src/components/focus-trap/focus-trap.tsx +++ b/packages/@headlessui-react/src/components/focus-trap/focus-trap.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { useEffect, useRef, diff --git a/packages/@headlessui-react/src/components/label/label.tsx b/packages/@headlessui-react/src/components/label/label.tsx index ea10aceaf5..2873449b90 100644 --- a/packages/@headlessui-react/src/components/label/label.tsx +++ b/packages/@headlessui-react/src/components/label/label.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { createContext, useContext, useMemo, diff --git a/packages/@headlessui-react/src/components/listbox/listbox.tsx b/packages/@headlessui-react/src/components/listbox/listbox.tsx index 50ff041ff4..bae2046c18 100644 --- a/packages/@headlessui-react/src/components/listbox/listbox.tsx +++ b/packages/@headlessui-react/src/components/listbox/listbox.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { Fragment, createContext, createRef, diff --git a/packages/@headlessui-react/src/components/menu/menu.tsx b/packages/@headlessui-react/src/components/menu/menu.tsx index 8eaa94fafc..578f22cdfd 100644 --- a/packages/@headlessui-react/src/components/menu/menu.tsx +++ b/packages/@headlessui-react/src/components/menu/menu.tsx @@ -1,6 +1,5 @@ // WAI-ARIA: https://www.w3.org/WAI/ARIA/apg/patterns/menubutton/ -import * as React from 'react' -import { +import React, { Fragment, createContext, createRef, diff --git a/packages/@headlessui-react/src/components/popover/popover.tsx b/packages/@headlessui-react/src/components/popover/popover.tsx index 419e0af3ce..3e21cbb796 100644 --- a/packages/@headlessui-react/src/components/popover/popover.tsx +++ b/packages/@headlessui-react/src/components/popover/popover.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { createContext, createRef, useContext, diff --git a/packages/@headlessui-react/src/components/portal/portal.tsx b/packages/@headlessui-react/src/components/portal/portal.tsx index b27f8ae189..3a375615fd 100644 --- a/packages/@headlessui-react/src/components/portal/portal.tsx +++ b/packages/@headlessui-react/src/components/portal/portal.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { Fragment, createContext, useContext, 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 96048ebbdd..c1af35c08d 100644 --- a/packages/@headlessui-react/src/components/radio-group/radio-group.tsx +++ b/packages/@headlessui-react/src/components/radio-group/radio-group.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { createContext, useContext, useMemo, diff --git a/packages/@headlessui-react/src/components/switch/switch.tsx b/packages/@headlessui-react/src/components/switch/switch.tsx index a807138d10..9e0728583d 100644 --- a/packages/@headlessui-react/src/components/switch/switch.tsx +++ b/packages/@headlessui-react/src/components/switch/switch.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { Fragment, createContext, useContext, diff --git a/packages/@headlessui-react/src/components/tabs/tabs.tsx b/packages/@headlessui-react/src/components/tabs/tabs.tsx index 748ccd1072..6c27793ce6 100644 --- a/packages/@headlessui-react/src/components/tabs/tabs.tsx +++ b/packages/@headlessui-react/src/components/tabs/tabs.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { Fragment, createContext, useContext, diff --git a/packages/@headlessui-react/src/components/transitions/transition.tsx b/packages/@headlessui-react/src/components/transitions/transition.tsx index 76f5d62d88..59c4f6349e 100644 --- a/packages/@headlessui-react/src/components/transitions/transition.tsx +++ b/packages/@headlessui-react/src/components/transitions/transition.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { Fragment, createContext, useContext, diff --git a/packages/@headlessui-react/src/hooks/use-event.ts b/packages/@headlessui-react/src/hooks/use-event.ts index 300062ad09..47115aa35a 100644 --- a/packages/@headlessui-react/src/hooks/use-event.ts +++ b/packages/@headlessui-react/src/hooks/use-event.ts @@ -1,4 +1,4 @@ -import * as React from 'react' +import React from 'react' import { useLatestValue } from './use-latest-value' export let useEvent = diff --git a/packages/@headlessui-react/src/hooks/use-id.ts b/packages/@headlessui-react/src/hooks/use-id.ts index 897bcad2fb..761d6c1c34 100644 --- a/packages/@headlessui-react/src/hooks/use-id.ts +++ b/packages/@headlessui-react/src/hooks/use-id.ts @@ -1,4 +1,4 @@ -import * as React from 'react' +import React from 'react' import { useIsoMorphicEffect } from './use-iso-morphic-effect' import { useServerHandoffComplete } from './use-server-handoff-complete' import { env } from '../utils/env' diff --git a/packages/@headlessui-react/src/internal/focus-sentinel.tsx b/packages/@headlessui-react/src/internal/focus-sentinel.tsx index 7e6b8ff8d7..de3268210d 100644 --- a/packages/@headlessui-react/src/internal/focus-sentinel.tsx +++ b/packages/@headlessui-react/src/internal/focus-sentinel.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { useState, FocusEvent as ReactFocusEvent } from 'react' +import React, { useState, FocusEvent as ReactFocusEvent } from 'react' import { Hidden, Features } from './hidden' diff --git a/packages/@headlessui-react/src/internal/open-closed.tsx b/packages/@headlessui-react/src/internal/open-closed.tsx index f596ddb206..143dc26d90 100644 --- a/packages/@headlessui-react/src/internal/open-closed.tsx +++ b/packages/@headlessui-react/src/internal/open-closed.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { createContext, useContext, diff --git a/packages/@headlessui-react/src/internal/portal-force-root.tsx b/packages/@headlessui-react/src/internal/portal-force-root.tsx index 56ea2271b5..d688f28459 100644 --- a/packages/@headlessui-react/src/internal/portal-force-root.tsx +++ b/packages/@headlessui-react/src/internal/portal-force-root.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { createContext, useContext, diff --git a/packages/@headlessui-react/src/internal/stack-context.tsx b/packages/@headlessui-react/src/internal/stack-context.tsx index df7b5b7be1..e8ff63d5bb 100644 --- a/packages/@headlessui-react/src/internal/stack-context.tsx +++ b/packages/@headlessui-react/src/internal/stack-context.tsx @@ -1,5 +1,4 @@ -import * as React from 'react' -import { +import React, { createContext, useContext, diff --git a/packages/@headlessui-react/src/utils/start-transition.ts b/packages/@headlessui-react/src/utils/start-transition.ts index e9b389b4ae..9fe7864327 100644 --- a/packages/@headlessui-react/src/utils/start-transition.ts +++ b/packages/@headlessui-react/src/utils/start-transition.ts @@ -1,4 +1,4 @@ -import * as React from 'react' +import React from 'react' export let startTransition = // Prefer React's `startTransition` if it's available.