server-reason-react icon indicating copy to clipboard operation
server-reason-react copied to clipboard

useId will have hydration issues

Open davesnx opened this issue 1 year ago • 1 comments

Implemented as an auto-incremental id starting at 0, but React implements this differently.

useId from their documentation: https://react.dev/reference/react/useId

There's some logic on tagging those ids as rendered from the server and also knowing how many ids are called in a tree/componnent locally.

Screenshot 2023-11-02 at 18 02 57 Taken from https://jser.dev/2023-04-25-how-does-useid-work

davesnx avatar Nov 02 '23 17:11 davesnx

Tests for useId https://github.com/facebook/react/blob/246d7bfeb0c90ecccd9531929b60a79d628a4c78/packages/react-dom/src/tests/ReactDOMUseId-test.js#L571

davesnx avatar Aug 27 '24 09:08 davesnx