Skip to content

Commit b6212b9

Browse files
committed
ensure that we regenerate the id when it is still null
1 parent ab820de commit b6212b9

File tree

1 file changed

+1
-2
lines changed
  • packages/@headlessui-react/src/hooks

1 file changed

+1
-2
lines changed

packages/@headlessui-react/src/hooks/use-id.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ export function useId() {
1818

1919
useIsoMorphicEffect(() => {
2020
if (id === null) setId(generateId())
21-
// eslint-disable-next-line react-hooks/exhaustive-deps
22-
}, [])
21+
}, [id])
2322

2423
React.useEffect(() => {
2524
if (state.serverHandoffComplete === false) state.serverHandoffComplete = true

0 commit comments

Comments
 (0)