isomorphic-style-loader
isomorphic-style-loader copied to clipboard
Broken on React 16.10 - Invariant Violation: Invalid hook call. Hooks can only be called inside of the body of a function component.
Stack trace:
- react.development.js:1533
[my-code/[isomorphic-style-loader]/[react]/cjs/react.development.js:1533:26
- react.development.js:1536 resolveDispatcher
[my-code/[isomorphic-style-loader]/[react]/cjs/react.development.js:1536:5
- react.development.js:1541 Object.useContext
[my-code/[isomorphic-style-loader]/[react]/cjs/react.development.js:1541:20
- useStyles.js:21 useStyles
[my-code/[isomorphic-style-loader]/src/useStyles.js:21:25****
I suspect this line https://github.com/kriasoft/isomorphic-style-loader/blob/a990d947e79b47251f1af827adc81918494413fd/src/useStyles.js#L29 is breaking the rule of hooks because it is running an effect conditionally
duplicated with #155
unfortunately, this package looks like abandoned :( I used this to be sure that everything uses this version react in package.json:
"resolutions": { "react": "17.0.1", "react-dom": "17.0.1" },