How to Upgrade React-Native version from 0.57.0 to 0.62.2

How to Upgrade React-Native version from 0.57.0 to 0.62.2

This article will guide you through the process of upgrading your React native version from a lower version possibly less than 0.59 to 0.62

Tl;dr it’s a cumbersome process if you don’t follow correctly.

Why upgrade to newer versions of React Native?

The major reasons for upgrading are

  • Speed boost! ✔
  • Fast refresh / live-reload ⚡
  • Hermes support (compiles the js code to binary, which helps in less startup time, faster response, smaller app size)
  • First-class support for flipper (an awesome debugging tool for react-native)
  • Support for React hooks 🙌
  • Other Bug fixes. 🐞

Well, the newer versions of React native ( >0.60) has a utility tool to upgrade easily. It uses git under the hood to upgrade your React native under the hood. But coming to older versions of react-native (<0.60) this support doesn’t work quite well. And in most cases, it requires you to manually upgrade.

So, to upgrade from 0.57.0 to 0.62.2 you need to first upgrade it to 0.58.6 and then 0.59.10 after this you’re okay to upgrade to 0.62 or higher. This is my personal experience. Because jumping directly to the latest version had many confusions and thus failures. So, I recommend to upgrade it in parts.

Here’s the actual upgrade process of React native from 0.57.0 to 0.62.2

  1. Delete your node_modules folder
  2. Go to this page and select your current version and the target version (increase each version at a time)
  3. Click “Show me how to upgrade” button
  4. Now scroll down and manually check the changes shown in the diff.
  5. Try to replicate the same in your code
  6. Now install all the packages using yarn install or npm i
  7. Clean the project using gradlew clean
  8. Do a build either by yarn android or android studio.
  9. If the build is successful try to run the app in your device else there’s a problem with the changed files, check diff again and repeat the steps 1 to 8.

That’s it. You now have the latest React Native version. You’ve successfully upgraded from 0.57.0 to 0.62.2 🎉

Let me know if you face any problems or if you have any better ways to do it. 

Subscribe to abdulghani.tech

And get the latest articles delivered right to your inbox!