Skip to content

'useid' was not found or 'react.useid' is not a function #6439

Answered by benjgil
benjgil asked this question in Help
Discussion options

You must be logged in to vote

This is because while the component is configured for react18, your env itself is still configured with react17 as its own dependency - the teambit.envs/env environment is currently configured still for react17.

Run bit show <env_component> to verify that this is the case in the dependencies section of the printout.

Solution
So, to update your env fully to be react18-compatible you need to manually update its own dependencies. The best way to currently do that is by adding a variant in the workspace.jsonc file of your react18 custom env's workspace, like so:

// inside the variants section
"react/react-version-envs/react-18-env": { // replace with the relevant selector for your env compone…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rishabh-ti
Comment options

Answer selected by benjgil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants