How To Upgrade Project to React-Native 0.57 (RN 0.57)
Today I decided to update our project to the latest RN version. It was not as easy and fast as I thought :)
After 30 mins of googling and fixing issues one after another, I finally got the working app. Hope this article will save some time for you too.
Upgrade to RN 0.57:
0. Copy IOS/Android folders in the safe place and remove them from the project. You will lose platform-specific settings, like app icon, permissions and custom build steps. Later, you may need to merge these changes with default files.
- Update react-native version in package.json:
“react-native”: “0.57.0”
2. To install this dependency, run yarn
command
3. The babel plugin was recently moved to the metro repo and published under metro-react-native-babel-preset
. So you need to install it:
yarn add metro-react-native-babel-preset -D
And upgrade your .babelrc
:
{
“presets”: [“module:metro-react-native-babel-preset”]
}
4. Add @babel/plugin-external-helpers
to development packages:
yarn add @babel/plugin-external-helpers -D
5. Add schedule@0.4.0
package to development packages:
yarn add schedule@0.4.0 -D
6. Init platform specific projects:
react-native upgrade
7. Link resources and libraries:
react-native link
8. Build and launch your app:
react-native run-ios
This solution worked fine for each of our team. If you have encountered any issue, please write a comment below.
P.S. If you enjoyed this article and want more like these, please clap and share with friends that may need it. You may also like my article: How to Build Forms Dynamically in React/Redux?
🚀 My team uses React/React Native to build production apps over 3 years. We help US startup founders to bring their ideas to life. If you need some help, send a message ✉️ oleg@productcrafters.io