uniforms icon indicating copy to clipboard operation
uniforms copied to clipboard

Consider replacing `randomIds` with `useId`

Open radekmie opened this issue 4 years ago • 3 comments

Last year, React introduced a new hook: useOpaqueIdentifier (https://github.com/facebook/react/pull/17322). I wasn't that eager to implement it, but things have changed, as it gets some lifting and will be replaced by useId (https://github.com/reactwg/react-18/discussions/111). This could be used to replace randomIds entirely, but has a drawback - we'd have to increase the minimum React version to 18.

I'll add it to the v4.0 milestone, but it may not be implemented that soon or even at all.

radekmie avatar Oct 22 '21 07:10 radekmie

(We've had a team discussion about this issue, and here are the notes.)

We've decided to use as soon as it'll be ready. It may not be in v4 as it may happen before React 18.

radekmie avatar Dec 10 '21 10:12 radekmie

React 18 has shipped and along with it the useId. If we upgrade to React 18 in v4, we should try to use it.

wadamek65 avatar Mar 31 '22 11:03 wadamek65

Since using useId will force us to declare a peer dependency of ^18 for React we've decided the benefits of using it are not worth it for now. We will postpone this change for another major version in the future (initially v5).

wadamek65 avatar Sep 08 '22 11:09 wadamek65