Skip to content

Commit 6c259a1

Browse files
thecrypticaceRobinMalfait
authored andcommitted
Add comment
1 parent 953bbb1 commit 6c259a1

File tree

1 file changed

+8
-1
lines changed
  • packages/@headlessui-react/src/components/tabs

1 file changed

+8
-1
lines changed

packages/@headlessui-react/src/components/tabs/tabs.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,14 @@ function PanelFn<TTag extends ElementType = typeof DEFAULT_PANEL_TAG>(
568568

569569
useIsoMorphicEffect(
570570
() => actions.registerPanel(internalPanelRef),
571-
[actions, internalPanelRef, id]
571+
[
572+
actions,
573+
internalPanelRef,
574+
575+
// The `id` prop is here to force a re-render of the
576+
// corresponding `Tab` whenever the `id` is calculated in React < 18
577+
id,
578+
]
572579
)
573580

574581
let mySSRIndex = useStableCollectionIndex('panels')

0 commit comments

Comments
 (0)