-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various sub-projects do have react and react-dom as dependencies resulting in hook-errors #11546
Comments
related: |
I'm seeing a similar issue with a project I'm working on. I'm making changes to both Two weird additional wrinkles:
I'm also confused about the referenced PR #11628 -- isn't that the opposite of what the OP is saying in this issue? My understanding is that React is freaking out because it's seeing multiple competing instances of react/react-dom, so I thought dev-/peer-dependencies would be the way to go for Storybook. |
Yes @VinceSJ there's multiple ways of solving this. I don't trust the "let's make everything a peerDependency" strategy will work at all. I'm proposing we fix it as the bundler config level. (we already do for the manager) |
Shouldn't this issue going to get fixed in the latest version: React 17, as per the docs here |
I saw a PR metioned above that fixes this. But what can we do until then? I have a clean install which was working and for some reason has now stopped working and all im getting is these hooks warnings. Was there a fix that i missed that someone could point me towards? |
ok so i updated React to 17 and blew away node_modules and yarn.lock. Now the docs are working |
I believe this was fixed in #12972. Closing. |
Describe the bug
Multiple react and react-dom dependencies inside of @storybook lead to the following type of error:
To Reproduce
e.g. https://github.com/storybookjs/storybook/blob/next/lib/components/package.json
or
git clone https://github.com/jookshub/storybook_cra_tsx.git
nvm use
npm i
npm run storybook
-> brokennpm run storybook-fixed
-> workingExpected behavior
react and react-dom should be peer-dependencies in all package.json files of @storybook or configured in a way that does not interfere with react hooks.
Screenshots
Additional context
See related solution for old issue: #4691 (comment)
The text was updated successfully, but these errors were encountered: