Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix maximum call stack size exceeded error on Tab component when using as={Fragment} #1826

Merged
merged 2 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/@headlessui-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix `ref` stealing from children ([#1820](https://github.com/tailwindlabs/headlessui/pull/1820))
- Expose the `value` from the `Combobox` and `Listbox` components render prop ([#1822](https://github.com/tailwindlabs/headlessui/pull/1822))
- Improve `scroll lock` on iOS ([#1824](https://github.com/tailwindlabs/headlessui/pull/1824))
- Fix maximum call stack size exceeded error on `Tab` component when using `as={Fragment}` ([#1826](https://github.com/tailwindlabs/headlessui/pull/1826))

## [1.6.6] - 2022-07-07

Expand Down
4 changes: 2 additions & 2 deletions packages/@headlessui-react/src/components/tabs/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ let TabRoot = forwardRefWithAs(function Tab<TTag extends ElementType = typeof DE
let internalTabRef = useRef<HTMLElement | null>(null)
let tabRef = useSyncRefs(internalTabRef, ref, (element) => {
if (!element) return
actions.forceRerender()
requestAnimationFrame(() => actions.forceRerender())
})

useIsoMorphicEffect(() => actions.registerTab(internalTabRef), [actions, internalTabRef])
Expand Down Expand Up @@ -490,7 +490,7 @@ let Panel = forwardRefWithAs(function Panel<TTag extends ElementType = typeof DE
let internalPanelRef = useRef<HTMLElement>(null)
let panelRef = useSyncRefs(internalPanelRef, ref, (element) => {
if (!element) return
actions.forceRerender()
requestAnimationFrame(() => actions.forceRerender())
})

useIsoMorphicEffect(() => actions.registerPanel(internalPanelRef), [actions, internalPanelRef])
Expand Down