question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React hooks error with material-ui

See original GitHub issue

I have an error with storybook and react hooks

Invariant Violation: 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 invariant (http://localhost:9001/vendors~main.c08119bb1baee695123a.bundle.js:298423:15)
    at Object.throwInvalidHookError (http://localhost:9001/vendors~main.c08119bb1baee695123a.bundle.js:311235:3)
    at Object.useContext (http://localhost:9001/vendors~main.c08119bb1baee695123a.bundle.js:334207:21)
    at useTheme (http://localhost:9001/vendors~main.c08119bb1baee695123a.bundle.js:185294:55)
    at http://localhost:9001/vendors~main.c08119bb1baee695123a.bundle.js:184916:91
    at Object.WithStyles [as render] (http://localhost:9001/vendors~main.c08119bb1baee695123a.bundle.js:185385:21)
    at extract (http://localhost:9001/vendors~main.c08119bb1baee695123a.bundle.js:188834:38)
    at Array.forEach (<anonymous>)
    at extract (http://localhost:9001/vendors~main.c08119bb1baee695123a.bundle.js:188825:25)
    at extract (http://localhost:9001/vendors~main.c08119bb1baee695123a.bundle.js:188830:11)

Example with the same error here https://github.com/alexnofoget/storybook-issue

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
ndelangencommented, May 22, 2019

Found a fix, opened a PR

4reactions
shilmancommented, May 30, 2019

Yowza!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-rc.3 containing PR #6859 that references this issue. Upgrade today to try it out!

Because it’s a pre-release you can find it on the @next NPM tag.

Closing this issue. Please re-open if you think there’s still more to do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

create-react-app MaterialUI Error: Invalid hook call
I want to do Create-react-app and use Material UI, but I get a Hooks Error. Am I missing something else? This is an...
Read more >
Material UI error: Invalid hook call. Hooks can only be called ...
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 Warning - React
Invalid Hook Call Warning ... You are probably here because you got the following error message: Hooks can only be called inside the...
Read more >
Invalid hook call error using Material UI : r/reactjs - Reddit
I am working on a React project created with create-react-app that uses material UI and I am getting these errors:.
Read more >
67009085/latest-react-hook-form-error-handling-with-material ...
Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found