Please tell me step by step process of upgrading React from version .13 to 15.0.1 .
To update your React version, install the latest versions of the react and react-dom packages by running npm install react@latest react-dom@latest . If you use create-react-app , also update the version of react-scripts . Copied! The command will update the versions of the react-related packages.
Update react version in package.json
Delete node_modules
folder
Run npm install
install process will fail if there is any version mismatch among other dependencies in package file, console will show the expected compatible version number. Update those and run npm install again.
Once install is complete, then build your application and test. If any error appear due to deprecated code, then you would have to fix those as well.
One of the deprecated syntax from ver 13, is usage of react.render
There you will have to import react-dom and use that to call render. There can be many other potential issues which you may encounter. So test you app properly.
React entries in package.json
that I have:
"react": "15.0.1",
"react-addons-perf": "15.0.1",
"react-addons-test-utils": "15.0.1",
"react-addons-update": "15.0.1",
"react-dom": "15.0.1"
All the best!
P.S. This is the process I follow, there may be some other way to do it.
By experience I can say that each version of react-native has breaking changes, for example from version 17 on, you need to remove @override on
public List<Class<? extends JavaScriptModule>> createJSModules()
So my advice is update progressively along with all you project dependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With