Skip to content

React.useId doesn't exist in React 16/17 #20

@s100

Description

@s100

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 [email protected].

My suggestion would be to temporarily eliminate usage of React.useId and use some other unique ID generator instead, and release this as say [email protected]. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions