Upgrading to React Native v0.59

Shreyas Nisal
2 min readApr 3, 2019

--

The stable version of React Native, version 0.59, was released on 12th March, 2019. Among other reasons why we should upgrade our projects to this version is the fact that it is this version that provides 64-bit libraries. Google requires that all applications have a 64-bit apk starting from 1st August 2019, and to build this 64-bit apk, we need React Native v0.59. So let’s take a look at how we can upgrade to this version.

  1. Open the package.json file and look for react-native in the dependencies block. Update the value to 0.59.0 or 0.59.1. Then run the command npm install at the project’s root directory.
  2. To directly update React Native from the terminal, run the command npm install react-native@0.59 at the project’s root directory.
  3. It is often a good idea to keep the react version updated with the react-native version. Hence, we would be doing that as well. Again, this can be done in two ways, either by editing the value in the package.json file or directly from the terminal.
  4. To do so from the file, open it and look for the key react in the dependencies block. Once found, update the value to 16.8.5. Next, run the command npm install at the project’s root directory.
  5. You can update directly from the terminal by running the command npm install react@16.8.5 at the project’s root directory.
  6. To finally replace all files according to the new react-native version, run the command react-native upgrade --legacy at the project’s root directory, entering ‘y’ whenever a file replacement is prompted.

Note: In case you made changes in the AndroidManifest.xml file, or any of the build.gradle files, etc., these may have been restored to how they were before. You would have to make those changes again.

--

--

Shreyas Nisal
Shreyas Nisal

Written by Shreyas Nisal

Software Engineer at Twilio | Ex Research Assistant at MIT Media Lab, Exertion Games Lab | Ex Intern at Twilio, BitHyve, Mednet Labs

No responses yet