Search code examples
javascriptreactjsthree.jsreact-three-fiberreact-three-drei

How to install a react-three/fiber and react-three/drei version compatible with "react": "^17.0.2"?


I having trouble with the installation of react-three/fiber and react-three/drei. Please tell me how to install a downgrade version of the two packages. I can't change the version of my react and react-dom because some packages might be affected by the changes.


Solution

  • You can target a specific version in the package.json file, try something like this:

    package.json

    "dependencies": {
    ...
      "@react-three/fiber": "7.0.6"
      "@react-trhee/drei": "7.5.1"
    ...
    }
    

    After the changes you will have to delete the node_modules and reinstall

    Alternatively if you already uninstall/remove the packages, you can target specific versions by doing:

    npm install [package]@[version]
    

    or

    yarn add [package]@[version]
    

    For eaxmple npm install @react-three/[email protected]