Invalid hook call
See original GitHub issueIf you use this component:
With this example project:
https://github.com/mui-org/material-ui/tree/master/examples/nextjs
You get:
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
How do we fix?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Invalid Hook Call Warning - React
There are three common reasons you might be seeing it: You might have mismatching versions of React and React DOM. You might be...
Read more >Invalid hook call. Hooks can only be called inside of the body ...
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the...
Read more >Invalid hook call. Hooks can only be called inside the body of ...
The error "Invalid hook call. Hooks can only be called inside the body of a function component" occurs for multiple reasons, having a...
Read more >Invalid hook call - How to resolve multiple versions of React ...
I noticed that whenever I link each individually, the former unlinks. So by doing npm link ./path-to-app/node_modules/react ./path-to-app/ ...
Read more >Invalid hook call. Hooks can only be called ... - Datainfinities
React error “Invalid hook call. Hooks can only be called inside the body of a function component” occurs due to many reasons. Learn...
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
@oliviertassinari I don’t have another computer, but I can add that the problem shows up here:
./pages/_document.js:60
and if you remove everything from the bottom up to and including this line, it goes away.
same issue with
Stepper
component