Upgrading to React 17 on app level breaks UI
See original GitHub issueHere’s the repro: https://github.com/Hypnosphi/test-storybook-react-17
Error I get is:
react.development.js:1431 Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
at resolveDispatcher (react.development.js:1431)
at Object.useContext (react.development.js:1439)
at useTheme (emotion-theming.browser.esm.js:112)
at useMenu (vendors~main.619dfba2fee0a3e45bd3.bundle.js:25841)
at Object.mapper [as current] (vendors~main.619dfba2fee0a3e45bd3.bundle.js:26274)
at ManagerConsumer (vendors~main.619dfba2fee0a3e45bd3.bundle.js:1484)
at renderWithHooks (vendors~main.619dfba2fee0a3e45bd3.bundle.js:42664)
at mountIndeterminateComponent (vendors~main.619dfba2fee0a3e45bd3.bundle.js:45343)
at beginWork (vendors~main.619dfba2fee0a3e45bd3.bundle.js:46457)
at HTMLUnknownElement.callCallback (vendors~main.619dfba2fee0a3e45bd3.bundle.js:28049)
Brief debugging showed that useTheme
imports React from DLL while the rest of manager UI imports it from node_modules/@storybook/ui/node_modules/react


Issue Analytics
- State:
- Created 3 years ago
- Reactions:14
- Comments:41 (24 by maintainers)
Top Results From Across the Web
React v17.0 – React Blog
React 17 enables gradual React upgrades. When you upgrade from React 15 to 16 (or, this time, from React 16 to 17), you...
Read more >Upgrading to React 17 - Medium
We finally upgraded our app to React v17 from v16. The v17 was released almost 3 years after the previous major release.
Read more >Upgrading to React 17 and Webpack 5 | by Chameera Dulanga
This article will discuss the steps to upgrading a React project to React 17 and Webpack 5 with my own set of tips...
Read more >An Ultimate Guide to Upgrading to React 18 - OpenReplay Blog
It makes it easier to build interactive UIs by enabling you to create reusable UI components that can be used to build the...
Read more >React 16 vs. React 17 | NextLink Labs
High Level Changes · Partial upgrade support · Supports the latest version of JSX · Supports nesting multiple react apps on the same...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed in #12972 / 6.1-beta. Closing.
Any plans to also increase the react-dom range to support 17?
Edit, looks like there are issues with npm 7 + storybook as well.