How to downgrade react native version after upgrading? - react-native

I was building an app on the version 0.70.6 then suddenly I saw the upgrade option after upgrading my app is not working on emulator. So, I want to downgrade the version. Please guide me.
I have tried this npm install react-native#a.b.c . But getting errors.

React Native Upgrade Helper will resolve your problem.
Left column: What's your current react-native version? => The version you want downgrade.
Right column: To which version would you like to upgrade? => The current version you are using.
Copy content in Left column and replace your current code(Right column).

Related

Is there a way to downgrade React-Native?

I have react-native version 0.69.0, but Expo SDK 45 only works with react-native 0.68.2. Is there a way to downgrade my project to this version?
I think this stackoverflow question by 'Sathyakumar Seshachalam' may help you.
link: Proper mechanism to downgrade react-native
Answer from chetan and liamnickell:
For existing projects if you want to install/downgrade to lower version
npm install react-native#a.b.c
This will install the version specified.
Check the installed version with react-native --version

How to select correct gradle version in React Native

I never upgraded my gradle since 4.3 and now i decided to upgrade my libs. Firstly i updated my react native version to 0.63. And now thinking to upgrade gradle as well. But cannot decide which version to upgrade?
Is there any docs for that, or always it should be updated to latest version?
EDIT: Got these errors below while updating

Why does expo gives error when install native-base

When I try to get native-base and when I run the app. It gives me that error. How can I fix that. I am using expo and I installed expo-font.
PLEASE HELP!
Looks like that's a bug in the native-base package.
There is a PR that resolves this issue, but as of me writing this one - it's still not merged yet.
The only workaround is to either try to install older version of native-base, either fork the native-base package and apply in the native-base code the change which fixes the issue.
Or of course, wait... until native-base contributors accept the PR and release a new version with the fix.

error Failed to fetch diff for react-native#x.x.x Maybe it's not released yet? upgrading react-native from 0.59.4 to 0.60.6

I am trying to upgrade from react-native 0.59.4 to 0.60.6 but I am getting below messages:
info Fetching diff between v0.59.4 and v0.60.6...
error Failed to fetch diff for react-native#0.60.6. Maybe it's not released yet?
info For available releases to diff see:
https://github.com/react-native-community/rn-diff-purge#version-changes
This is the command I use:
react-native upgrade 0.60.6
Some say this could be because of proxy configuration but I am not behind a proxy. Any help is appreciated. Cheers.
You can do this as follows.
yarn add react-native #*version*
Pay attention to this.
If you're on a version <= 0.59.10 and want to go to e.g. 0.61, you need to upgrade to 0.60 first, then you can run the upgrader to get up to 0.61.
Found it! Apparently, react-native upgrade command is not working for all versions of react-native. I tried it for version 0.60.0 and it worked.
react-native upgrade 0.60.0
After this running react-native upgrade upgraded to the latest version.
P.S. There will be some files that won't be upgraded automatically. You will need to update them yourself.

react-native error when going over tutorial at react native site

I am a complete beginner, so please provide some explanation.
I am following react-native tutorial at https://facebook.github.io/react-native/releases/0.19/docs/tutorial.html
I run command to init project, I just call it Movies instead of AwesomeProject as the tutorial explains.
Then I copied the complete code from the bottom of the tutorial into my index.ios.js, save the project and refreshed emulator and I get this error
error: bundling failed: "TransformError:
/Users/dinob/reactnativework/Movies/index.ios.js:
Unexpected token ) (While processing preset:
\"/Users/dinob/reactnativework/Movies/node_modules/
babel-preset-react-native/index.js\")"
React-native-cli: 2.0.1
React-native: 0.47.1
React: 16.0.0-beta.2
What I can see is, the tutorial you're following is for RN 0.19 while the newest stable version is 0.47. All the examples codes inside those use the older ES5 syntax and the not newer class based syntax that came in ES6/ES2015
Firstly, please make sure you're following the newest tutorial version and its code. You can do that from here.
https://facebook.github.io/react-native/docs/tutorial.html
The error which I can see there is related to a babel transform and could possibly be attributed to newer version of React Native plus a newer version of React running older code. So you should probably start with a newer tutorial and take it from there.
Also, the use of react-native-cli is now depreciated. You should use create-react-native-app to start a new project. It's all in the docs.
Hope it helps!