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.

Material UI Icons cause to "invalid hook call" issue

See original GitHub issue

Hi. I use a simple template example sign-in in my own project

After starting the project Chrome is showing me error “Invalid hook call. Hooks can only be called inside of the body of a function component.”

Zw0cfIr

Using trial and error I’ve found that the line "LockOutlinedIcon " causes the problem.

<Avatar className={classes.avatar}>
          <LockOutlinedIcon />
</Avatar>

Any icon I use through import LockOutlinedIcon from '@material-ui/icons/LockOutlined'; causes the error.

Environment Material-UI core - 4.3.1 Material-UI icons- 4.2.1 React - 16.8.6 React-dom - 16.8.6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
oliviertassinaricommented, Oct 24, 2019

@ithinco I would encourage you to report your issue on StackOverflow, you should likely find better luck.

5reactions
support[bot]commented, Aug 4, 2019

👋 Thanks for using Material-UI!

We use the issue tracker exclusively for bug reports and feature requests, however, this issue appears to be a support request or question. Please ask on StackOverflow where the community will do their best to help. There is a “material-ui” tag that you can use to tag your question.

If you would like to link from here to your question on SO, it will help others find it. If your issues is confirmed as a bug, you are welcome to reopen the issue using the issue template.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why I'm getting this Error: Invalid hook call. Hooks can only be ...
Why I'm getting this Error: Invalid hook call. Hooks can only be called inside of the body of a function component/ · You...
Read more >
Material UI Icons cause to "invalid hook call" issue #16884
After starting the project Chrome is showing me error "Invalid hook call. Hooks can only be called inside of the body of a...
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 error using Material UI : r/reactjs - Reddit
Solutions tried: Delete react folder from node_modules: not ideal since this project is being worked with a team and will be deployed to...
Read more >
React Hook Errors with Material UI inside Forge Confluence ...
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 >

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