Upgrading react native to latest version

react-native-git-upgrade
upgrade react-native cli
react-native versions
react native update app version
react-native cli version
react-native-version-check
downgrade react-native version
react-native version mismatch

I have an application which runs on react-native 0.49.3 I want to upgrade to the latest version which is v0.57.4.

Should I incrementally update it? For example 0.49 -> 0.50 -> 0.51 etc Or I can just update it to to the latest version?

Do you suggest using react-native-git-upgrade or rn-diff?

My advice is to upgrade to the latest version. There will be enough dependency issues anyway so you're best dealing with them only once.

From the React Native upgrade page (https://facebook.github.io/react-native/docs/upgrading)

you can run:

npm install -g react-native-git-upgrade

react-native-git-upgrade

UPDATE: I've never had a problem before with upgrades, but was recently on a project where we upgraded from an old copy of React Native 0.44.3 to a newer version (first to 0.57.8, then to 0.55.4, then to 0.58.3 while struggling with stability) and discovered that it's not always as easy as running those commands. Be warned that this could be a long, tedious process, especially if you have not upgraded regularly and have a long gap between upgrades. In this case, it was 18 months.

First, there have been changes to the upgrade process itself (react-native upgrade, to now react-native-git-upgrade) itself. So, if you're using a version that's a year old or more there could be some manual discrepancies that you'll have to go through. Some are spelled out after running the react-native-git-upgrade command, and some are not. I was amazed at the number of people on Stack Overflow going through the same undocumented circular issues of a seemingly innocent upgrade. I was not expecting that. I'd be OK with Facebook not adding any features for 6 months and simplifying the upgrade process before moving on.

Second, make sure your version of React Native uses the right dependencies. Later versions of the upgrade tool (react-native-git-upgrade) try to account for this, but double check at https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md to see if the version of RN that you're upgrading to requires a specific dependency. Some do while others do not.

Next, library hades is real, depending on how big your project is. In our case, several modules in use in our 0.44.3 version have now been deprecated or no longer maintained or even work differently with the later versions of RN. I didn't consider this enough when starting this process. This caused several instances of code rewrite just to upgrade!! Yikes!

Also, just as some versions of React Native require specific versions of dependencies, other modules require specific versions of some dependencies. Worse, sometimes these are incompatible and conflicting versions, of various libraries. Save some time and write a user story or two to account for this. Go through every module you're using and see if there are any compatibility statements on their GitHub page. Some Readme files will tell you to use certain versions of their module with certain versions of React Native. Others won't and you may find out later there are requirements. But even going through this process and anticipating issues, you'll thank yourself later.

Once you're up to date and stable, consider upgrading regularly to minimize the upgrade nightmare that I just went through.

Upgrading React Native to version 0.59 and beyond: a step-by-step , If you have a project in the version older than React Native 0.61, you should probably start thinkin Tagged with reactnative, mobiledev,  Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it straightforward for you.

Just change the path to the project for which you want to upgrade the react native version and then run this command:

react-native upgrade

and after running this command you will see some questions. Type n to discard the change to that file or type y if you want to modify that file. It will automatically install the latest version of react-native for your project. More info at: https://facebook.github.io/react-native/docs/upgrading

OR

You can upgrade react native version by this simple step:

1- Just go to package.json file of your project

2- After that, look for these lines

"dependencies": {
    "react-native": "0.57.8",
 }

3- Change the react-native version to any version that you want to upgrade to in "dependencies".

4- After this run npm install and react native version will be upgraded for your project.

How To Upgrade React Native To The Latest Version, My advice is to upgrade to the latest version. There will be enough dependency issues anyway so you're best dealing with them only once. Upgrading a React Native app by creating a new project. Step 1: Upgrade the React Native library. That line of code upgrade your React Native global library or install a new Step 2: Create a new React Native project. After upgrading the library to the latest version, you have to create a new

  1. You will need @react-native-community/cli to upgrade to the latest version of react-native, sadly not mentioned anywhere.

    npm install -g @react-native-community/cli

  2. Install react-native-git-upgrade

    npm install -g react-native-git-upgrade

  3. Now go to your project.

    cd your-react-native-project

  4. Now you can run the upgrade command.

    react-native upgrade

Upgrading react native to latest version, version. I've read many horror stories from people who have spent days trying to upgrade React-Native to the latest version. The official guideline  Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

I recommend visiting this page: https://github.com/react-native-community/rn-diff-purge

because you can see the list of exactly what changes in each version. I find it's simpler to manually change config settings after starting from your version that is proven to work properly via react-native run-android and react-native run-ios.

It sounds like a horrible task, but it's not very difficult for your fingers or brain to remove red lines and add green lines--at least compared to alternatives such as Googling to sort out horrific error messages in the Android/iOS build systems.

I also believe that it's a good idea to manually change config settings for example going from 0.44 to 0.59 because you get more of an opportunity to see exactly what is changing in each version. You'll see the changes are reasonable and generally have bearing on fostering future automation and increasing the build systems' robustness and aversion to breakage.

Additionally, changes were implemented in RN 0.59 that makes react-native upgrade better, and in addition to my additional statement, the whole 0.59 release is pretty massive and important for future: http://facebook.github.io/react-native/blog/#upgrading-to-059

I'm not even going to talk about react-native upgrade or react-native-git-upgrade because I find those to be generally a source of nightmares especially if you get into react-native unlink and react-native link.

The easiest way to upgrade React Native to the latest version, run this app. React Native Upgrade Helper logo What's your current React Native version? 0.62.2. To which version would you like to upgrade? 0.63.0-rc.1. Upgrading a React Native app by creating a new project. The second, the oldest and the best way, for now, is creating a new project in the latest react native version. After that, you should move all the files from the old repo to the one you have just created.

You can update to the latest version directly, I'd recommend to do it with react-native-git-upgrade, but do be careful to read the update release notes on the versions up to yours, they have some notes about things you should do manually that the upgrade will not. You can find the notes here: https://github.com/facebook/react-native/releases

The notes are usually on top in the changelogs, I know the latest releases had some of those and gave me some work to update from 0.54 recently so be aware.

React Native Upgrade Helper, A Simple Migration Guide to Update React Native to the Latest Version. with code snippets. React Native has become one of the most popular  You will need @react-native-community/cli to upgrade to the latest version of react-native, sadly not mentioned anywhere. Install react-native-git-upgrade npm install -g react-native-git-upgrade Now go to your project. cd your-react-native-project Now you can run the upgrade command. react-native

The Easiest Way to Upgrade React Native to Version 0.60.5, Today the latest version is 0.60, and 0.61 is right around the corner. So, do you really need to update? And is it really that painful? Why you need  The easiest way to upgrade React Native to the latest version. I’ve read many horror stories from people who have spent days trying to upgrade React-Native to the latest version. The official guideline as mentioned here do not work in most cases. Below is the way I found out after so many trials and errors to be the easiest.

React Native: Upgrade Dos and Don'ts, Upgrading React Native is a pain but a necessary part of having a deployed app. Upgrade the project using react-native-git-upgrade [version]; Run my post version of React Native I began upgrading all the dependencies to the latest. Upgrading to React Native 0.57 When you upgrade to this version you need to upgrade react and react-test-renderer to version “16.6.3”, as stated in the release notes. If you run into any xCode

Yet Another Article About Upgrading React Native, #Before you upgrade. React Navigation 4 is still maintained and will stay compatible with the latest version of React Native. We'll accept small pull requests and release bug fixes. While we won't be actively working on new features for React Navigation 4, they may be occasionally backported.

Comments
  • There's no mention of incremental updates on the documentation. The only thing that they mention is this: "Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require." Took it from here: facebook.github.io/react-native/docs/upgrading
  • My advise: wait with RN updates for at least half a year to give package maintainers a chance to catch up (and make your own life easy). I've had issues when updating RN in the past, now I just wait about a year, then create a new project with newer version and migrate my code... that seems to be a more simple and error prone task than updating RN in an existing project.
  • That is a great answer! I would add that github.com/pvinis/rn-diff-purge is a useful too, as it can show you the specific changes between each version. I no longer upgrade using react-native-git-upgrade due to issues that I have had, but instead I just do it manually, and as you said I try to do it frequently too.
  • Thanks Andrew!! I appreciate the comment, and also, the purge solution sounds great but I never actually used it. I'll play around with that the next time.
  • I like it as it gives a nice git diff so you can see what has changed. Very useful for manual upgrades.
  • react-native-git-upgrade is officially dead. Use rn-diff-purge to get up to RN 0.59.x, and after that use react-native upgrade. github.com/facebook/react-native/issues/…
  • @lukewilliams, It's about time! Facebook really dropped the ball and made some upgrades way too difficult. I'm glad they're trying to simplify it. rn-diff-purge is a good start.
  • I'm currently on 0.57.1 and haven't been able to target upgrading to 0.59.1. Is there some additional process I need to go through?
  • @Petrogad Hi! can you share your package.json react native version after running the above command? so that I can guide you further.
  • for me it stays at "react-native": "^0.57.1" I feel like I'm doing something goofy as all the docs seem to point towards that. Also worth noting, when I run that command it additionally tells me to go grab the old upgrade tool, react-native-git-upgrade
  • I am updating my answer wait.
  • yeah probably not necessarily and if you do get any error by the second method then do update that library for the particular react native version.