- Stash the existing modifications by running
- Create a new branch by running
git checkout -b upgrade/react-native-0-XX-0
Checks: when running
git status, you have no untracked or no modified files
- Look at your actual version of React Native
Lets say it is
- Find the changelog here: https://github.com/facebook/react-native/releases/tag/v0.X.0 where X is the minor of your react native version, note down the major breaking changes you'll have to consider later.
Check: I have a clear list of deprecated items to check.
You want to upgrade one version at the time of react native, but include the patches that are bug fixes for the new version
- In this case, you want to go to
0.46.0since for the version
0.46, react-native releases 4 bug fixes that you would have to fix yourself later if you had stay to
- If other modules or libraries have to be updated for compatibility reasons, update them following the upgrade native module steps.
- Once the React Native upgrade is completed, follow the tests steps (simulator and device) to perform one upgrade at a time.
- If react native cause a breaking changes in native side (you would see that in the changelog):
- Open your
android/settings.gradleand list all module imported
- Compare this list to your
podfileif you use cocoapods, and the linked framework (in Xcode, the library directory that contains both react-native and react-native plugins framework) @TODO @tycho insert photo
- For each package found, look at the github repo to see if it has been updated, or has pending issues that may jeopardize the upgrade process
- Upgrade the module in
There are also some modules that always require an update for a RN upgrade (example:
react-native-svg)Check: you can now build android and iOS.
Example: PropTypes gets moved to another package.
- Try to see if the failing module has an existing fix (then upgrade)
- Otherwise, fork it, and apply the same principle you did on your code to your newly created package.
// @todo: Tycho
// @todo: Tycho
- Once you have tested that everything is working fine on both iOS and Android, deploy on device (do not merge your branch)
- Run the command to hard deploy from your branch to hockeyapp
- Test that everything is working fine on devices
- If everything is correct, merge and soft deploy
If this is taking too long you can create a new React Native project from scratch with
There can also be cache issues (with yarn or gradle for instance) so if your project doesn't take long to be cloned you can clone a new instance of your project if you're stuck.