close

How to use create-react-app with an older React version?

Hello Guys, How are you all? Hope You are very well and safe. Sometimes we need to create our React App With Older React Version using create-react-app. So we will Learn How to use create-react-app with an older React version? So let’s start this article without wasting your time.

How to use create-react-app with an older React version?

  1. How to use create-react-app with an older React version?

    As I think create-react-app command does Not give any facility to create your react project with a custom react version. create-react-app will always install latest react packages. But We Can Downgrade Our React Version manually. First Of all, Open Your package.json file Search For react and react-dom under dependencies, and change both package versions to whatever you want to use I want to use 17.0.2. Just Like given below: “react”: “^17.0.2”, “react-dom”: “^17.0.2”, Then delete your node_module folder: rm -rf node_modules Now, run npm install: npm install And now Your Projects React Version is changed to React 17. Thank You.

  2. create-react-app with an older React version

    As I think create-react-app command does Not give any facility to create your react project with a custom react version. create-react-app will always install latest react packages. But We Can Downgrade Our React Version manually. First Of all, Open Your package.json file Search For react and react-dom under dependencies, and change both package versions to whatever you want to use I want to use 17.0.2. Just Like given below: “react”: “^17.0.2”, “react-dom”: “^17.0.2”, Then delete your node_module folder: rm -rf node_modules Now, run npm install: npm install And now Your Projects React Version is changed to React 17. Thank You.

Solution 1:

As I think create-react-app command does Not give any facility to create your react project with a custom react version. create-react-app will always install latest react packages. But We Can Downgrade Our React Version manually.

First Of all, Open Your package.json file Search For react and react-dom under dependencies, and change both package versions to whatever you want to use I want to use 17.0.2. Just Like given below.

  "dependencies": {
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    ...
  },

Then delete your node_module folder.

rm -rf   node_modules

Now, run npm install.

npm install

And now Your Projects React Version is changed to React 17. Thank You.

Conclusion

It’s all About How to use create-react-app with an older React version?. I hope You understand how to use it. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Leave a Comment