React Native version upgrade
Note (from August 2019): This document is pretty outdated (first written in January 2016) and helped me a lot when React Native was still much more immature than it is now. Consider using expo these days which provides a much easier React Native workflow.
React native version upgrade
- Check release notes for breaking changes
-
Check updates with
ncu(npm-check-updates). Checkreactdependency ofreact-native$ ncu -
Update dependencies in
package.json(including the react native version)$ ncu -uor
-a,--upgradeAll$ ncu -a -
Reinstall
nodes_modules\to$ rm -rf node_modules/ $ npm install -
Use npm
postinstallscript to copy and overwrite changed files intonode_modules(this is a fix for adapting external modules)$ npm run postinstallwhich is equivalent to
$ cp -f -R scripts/hotfix/* ./ | true -
Upgrade react-native with APP-IDENTIFIER
de.myCompanyName.myAppNameThis builds all the template files again as
react-native initdoes and compares the files where changes have occured.$ react-native upgrade --package "<APP-IDENTIFIER>"Overwrite <FILENAME>?--- sayyesto all
-
Fix conflicts by checking the
git diff- In
WebStormpresscmd + dto see thegit diff - Common changes: _ in iOS: remove the default Launchscreen _ in Android: variable for app identifier because of fastlane
- In
-
Check xcode project:
in
general --> linked frameworksinbuild phases --> link binary with librariesmake sure it shows the
house🏠. If not, remove and add again.
Discuss on Twitter ● Improve this article: Edit on GitHub