This online tool shows the diff between two different React Native versions.
If npx react-native upgrade does not work, we can use this tool to manually
update the files in order to upgrade React Native.
The upgrade helper needs two pieces of information to show a complete diff of
the files between any two versions of React Native:
- The current version of React Native, ex:
0.64.0.
- The version we would like to upgrade to, ex:
0.66.0.
Click on the gear icon in the upgrade helper to enter the app name. This is
important because some file changes include the app name. The upgrade tool
uses RnDiffApp as the default app name. We want to make sure it is the app
name we are using, and not RnDiffApp.
The next step would be to go through each file in the diff and update the
files manually, starting with package.json.
Note: Sometimes the upgrade helper will include changes to the
ios/app_name.xcodeproj/project.pbxproj file. Do not update this file
manually, it is updated automatically after running pod install. Read this
thread on the React Native community upgrade support repo for more information
on how to update the project.pbxproj file correctly:
React Native community upgrade support issue #13.
After updating the files, run the following commands in a terminal:
- Run
yarn install in the project root directory.
- From the project root directory run
cd ios and then
rm -rf Pods && rm Podfile.lock (optional but recommended).
- Run
pod install inside the ios directory.
- Finally, run the android and iOS builds to make sure that there are no build
issues.