Operational seems to have an issue with duplicating react
See original GitHub issueAccording to this documentation: https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react
I have duplicate reacts, which is a problem.
$ npm ls react
ipfsplay@1.0.0 D:\code\ipfsplay
+-- @operational/components@18.0.0
| `-- react@16.14.0
`-- react@16.14.0
Here are my dependencies:
"dependencies": {
"@operational/components": "^18.0.0",
"emotion": "^9.2.12",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-emotion": "^9.2.12"
}
And its giving me this error:
Invalid hook call. Hooks can only be called inside of the body of a function component.
It seems weird that operational has its own react if react needs to be top level. Whats going on and how can I fix it?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
React redirect on error avoiding code duplication
On each page on my app I make a request to the graphql client, const Profiles = () => { // Omitted code...
Read more >Duplicate TypeScript fragment imports with React Apollo #3990
The issue seems to come in when the imports aren't identical in both files (not in the CodeSandbox I've just changed the order...
Read more >It is not possible to react to an entity being duplicated - Drupal
1) Add a createDuplicate() method to Entity Storage, move the current logic there, call it from the entity class (just like we do...
Read more >You Probably Don't Need Derived State – React Blog
All problems with derived state that we have seen can be ultimately reduced to either (1) unconditionally updating state from props or (2) ......
Read more >Optimize React apps using a multi-layered structure
As you can see, FooComponent1 and FooComponent2 are affected by a code duplication issue. In particular, the API endpoint is being duplicated, ...
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 FreeTop 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
Top GitHub Comments
LOL I found this in react:
I’m thinking about using it to set the dispatcher 🤔
I just encountered this again and the peer dependency versions in operational-ui are different than the actual versions it requires and it ends up causing this issue.
I’ll file a different bug but for the record I had to dig into the package.json under my node_modules folder and find the actual versions in there and install those exactly.