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
PR #16 introduced a dependency on React's useId Hook. Unfortunately this Hook only exists in React 18, not React 16 or 17. react-json-view-lite is still meant to work in React 16, 17 and 18 which means unfortunately this was a breaking change. We still use React 17 (the React 18 upgrade is going to be difficult for us for reasons too complex to explain here) so this change broke us.
For now we are working around this by pinning to react-json-view-lite@1.1.0.
My suggestion would be to temporarily eliminate usage of React.useId and use some other unique ID generator instead, and release this as say react-json-view-lite@1.2.1. Later, if you want to move to use React.useId again, you can formally drop support for React 16 and 17 at the same time, document the breaking change, and bump your major version number to react-json-view-lite@2.
The text was updated successfully, but these errors were encountered:
Hi! I haven't noticed that the useId Hook exists only in the React 18 😢
Yes, I think the best solution is to eliminate the useId. I don't want to add any dependencies to the library since it was the original goal - to have no dependencies except React itself. But it might be challenging to write correct useId for all use cases (including SSR) from scratch.
PR #16 introduced a dependency on React's
useId
Hook. Unfortunately this Hook only exists in React 18, not React 16 or 17.react-json-view-lite
is still meant to work in React 16, 17 and 18 which means unfortunately this was a breaking change. We still use React 17 (the React 18 upgrade is going to be difficult for us for reasons too complex to explain here) so this change broke us.For now we are working around this by pinning to
react-json-view-lite@1.1.0
.My suggestion would be to temporarily eliminate usage of
React.useId
and use some other unique ID generator instead, and release this as sayreact-json-view-lite@1.2.1
. Later, if you want to move to useReact.useId
again, you can formally drop support for React 16 and 17 at the same time, document the breaking change, and bump your major version number toreact-json-view-lite@2
.The text was updated successfully, but these errors were encountered: