Closed prenx4x closed 6 months ago
Downgrading to v8.15.19 works without issues - https://github.com/pmndrs/react-three-fiber/issues/3267
You have multiple versions of React, as explained by the error. ESM.sh must be loading the latest version of React when resolving peer dependencies. Specify react 18.3.1 and react-dom 18.3.1.
I have this simple code in html to run a react-three-fiber canvas -
But I get the error -
In the sources tab, I do see react v18.2.0 and v18.3.1, I am not sure why there are 2 versions of react there but maybe that is reason for the invalid hooks error. If I remove react-three dependency, then it works fine with one version of react.
How can I resolve this issue?
CodeSandbox