Hello, React developers, If You don’t want to use React 17 as of now then? In This article, we are going to learn about How to downgrade React version 17 to 16? let’s start this article.
How to downgrade React version 17 to 16?
- How to downgrade React version 17 to 16?
To downgrade React version 17 to 16 First Of all, Open Your package.json file Search For react and react-dom under dependencies, and change both package versions to 16.14.0. Just Like given below: “react”: “^16.14.0”, “react-dom”: “^16.14.0”, Now, run npm install. And now Your React Version is changed to React 16. Thank You.
- downgrade React version 17 to 16
To downgrade React version 17 to 16 If You Don’t want to use React 17 Then Just downgrade to react 16 Just run this command in your terminal: npm install –save react@16.14.0 react-dom@16.14.0 Now, Your react version is downgraded to React 16. Thank you.
Method 1: Changing package.json
First Of all, Open Your package.json file Search For react and react-dom under dependencies, and change both package versions to 16.14.0. Just Like given below.
"dependencies": {
"react": "^16.14.0",
"react-dom": "^16.14.0",
...
},
Now, run npm install.
npm install
And now Your React Version is changed to React 17. Thank You.
Method 2: Using Commandline
If You Don’t want to use React 17 Then Just downgrade to react 16 Just run this command in your terminal.
npm install --save react@16.14.0 react-dom@16.14.0
Now, Your react version is downgraded to React 16. Thank you.
Method 3: Run This Command
Just uninstall the react 17 and install the react 16
npm uninstall react
Then install React 16 Just run this command
npm install react@16.14.0
Conclusion
It’s all About this article. Hope this method worked for you. Comment below Your thoughts and your queries. Also, Comment below which method worked for you?
Also, Read
- Uncaught ReferenceError: the process is not defined
- How to redirect in React Router v6?
- How to downgrade React version 18 to 17?