New React Native Project with Old Version of React Native

New React Native project with old version of react native

There is a new parameter in react-native init that allows just this. Try:

react-native init --version="react-native@0.36.0" MyNewApp

Here my source. I have successfully tested it with react-native-cli 2.0.1.

How to run an old version of react native

You should navigate to project directory (if you aren't yet)

cd PATH_TO_PROJECT_DIRECTORY

run the following command to install the dependencies

npm install

then if the react-native version is 0.59.10 and lowers you should also run the command below to link the dependencies to your native android and ios project.

react-native link

and then run one the following commands based on your device

for android

react-native run-android

for ios

react-native run-ios

React Native init specific version

This should do the trick:

$ react-native init newproject --version X.XX.X

React Native doesn't install specific version 0.67 , but install 0.68(latest) version

The problem is that --template already uses a version, the one of the template, thus --version has no effect. You need to specify the correct typescript template version for the correct react-native version. For 0.67.X this is 6.9.* which is documented here.

Thus, the following should work.

npx react-native init RNCComponents --template react-native-template-typescript@6.9.6 

Do not ask me why it is 6.9.6 rather than 6.9.4, but this one was 0.67.2 rather than 0.67.4.

Can't create new project and upgrade to React Native version latest 0.69.1

You have to remove the current react-native library and install the new one.

Following set of commands have worked for me

  1. npm uninstall -g react-native-cli
  2. npm uninstall -g react-native
  3. npm install -g react-native
  4. npm upgrade -g

Why does Expo create React native app with old versions of dependencies?

When you use expo's latest version, it's not necessary that your expo will ship with the latest React version or the latest React native version.

Expo comes with a lot of other packages (some of it are its own packages, some are third party). Therefore, all the packages used in an Expo version need to be compatible with whatever version of React they are using.

If they are not compatible, expo needs to change and update its own packages, at the same time, wait for other third party packages they use to be compatible with React's latest version, in which time the React team may perhaps come out with another version.

Such a task takes time, resources and effort from several different teams. Therefore, expo uses the React version that is compatible with all the packages they use.

The React environment (including React Native) is constantly changing and updating. This has been the case for quite some time now. So, you should really not expect Expo's latest version to always ship with the latest React or the latest any other package that they use.

There is also the matter whether the latest React native version is using the latest React version as well.

Hope you get my drift. A lot of packages, a lot of different teams, an ever changing React environment, costs, effort, time all of these play a vital role in deciding whether to upgrade to React's latest version, which currently is 17, or not.

But, give them some time, they will update to the latest version soon enough. :)



Related Topics



Leave a reply



Submit