-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Invalid hook call #14
Comments
The Even if the version in dependencies were Edit: Been wrestling with the exact same error in another project (not through this library however, but found this from a discussion at work), where the problem was that there were multiple versions installed. |
@GonzaloHuerta However! If this is still a problem, or if it happens in the future, you might find success with specifying a resolver in your "scripts": { ... },
"dependencies": { ... },
"resolutions": {
"**/react": "^17.0.1",
"**/react-dom": "^17.0.1"
},
... |
Any news on this issue? |
IDK why, but I fixed this by removing node_modules from @ideasio/add-to-homescreen-react which is located in node_modules of application |
I had the same issue. I think it's caused by this projects package.json declaring react as dependency, not as dev or peer dependency. |
Yeah, a common issue with React libs. I tried copying it into my src instead of including it in my package.json, but it won't build that way cause it uses some language extensions or something. So I forked it and removed the react deps altogether because I'm not sure what the peer dependencies should be set to. This really should be fixed. In the meantime, for anyone who wants to use my fork, I warn you that I'm no expert, but here: |
I implemented
add-to-home-screen-react
in a project with react version 16.13.1 and it works perfect but in another project with version 17.0.1 it throws: Error: Invalid hook call. Any idea why? Thank you!The text was updated successfully, but these errors were encountered: