You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pitfall:
With server rendering, useId requires an identical component tree on the server and the client. If the trees you render on the server and the client don’t match exactly, the generated IDs won’t match.
Why is useId better than an incrementing counter?
[...]
Inside React, useId is generated from the “parent path” of the calling component. This is why, if the client and the server tree are the same, the “parent path” will match up regardless of rendering order.
Description
Using
useId
always trigger a hydration mismatch between server and clientExpected behaviour
No hydration errors should be triggered
How to reproduce
tuono new project
useId
and render it in any place of the applicationScreenshots
System Info
System info (Rust)
Additional context
#364 (comment)
The text was updated successfully, but these errors were encountered: