Closed Geofflew closed 3 years ago
Any solution to this?
Anyone find any solution to this? Wondering if it is because I am attempting to use react photo collage on react 17.0.1. When I run npm ls react in the terminal I see that there are still unmet dependencies required by the current version of react-photo-collage. Does it have something to do with different versions of react being installed?
I see the same issue in React 17.0.1. I believe this is because React is specified in dependencies
instead of peerDependencies
. This causes multiple versions of React to be loaded. See React docs here: https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react A workaround as mentioned in there is to potentially use yarn resolutions if you are using yarn until it is fixed.
I fixed this by going to the react-photo-collage node module and deleting the react and react-dom modules, which duplicate those installed by create-react-app.
I fixed this by going to the react-photo-collage node module and deleting the react and react-dom modules, which duplicate those installed by create-react-app.
i tried by deleting react and react-dom modules, still not working...
I have moved react and react-dom from dependencies
to peerDependencies
to solve problem caused by mismatching versions of React. Please use the latest version available.
I get invalid hook errors when I try running this in my react app
Uncaught Error: 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: