2

I've migrated from Material Ui v3 to v4 on a create-react-library project. This project is a dependency on others project to share components. When I want to display a material-ui component, I have an Error: Invalid hook call.

I explained my error here :

https://github.com/mui-org/material-ui/issues/18482

Thanks in advance for your responses :)

3
  • And what was their answer there? Commented Nov 21, 2019 at 15:55
  • Same problem for me, Im trying to create a component lib for remix using rollup, but I get invalid hook error. Did you find any solution? Commented Aug 11, 2022 at 6:42
  • I was never able to resolve this problem myself and had to just stop using a particular mui component, only the Autocomplete component caused me this problem. Commented Jul 9, 2024 at 20:50

1 Answer 1

2

In your package.json Remove react and react-dom from "devDependencies"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.