This should do the trick:
$ react-native init newproject --version X.XX.X
Answer from Bataleon on Stack OverflowVideos
» npm install @react-native-community/template
» npm install react-native-set-version
» npm install create-react-native-app
There is no way to specify react native version in expo cli. But you can specify SDK version in expo cli. Each SDK corresponds to particular react native version you can find the react native version for the expo sdk here(https://github.com/expo/react-native/releases)
For example, if you want to work with react native 0.61.4, you can use expo sdk-37.0.1
expo init --template [email protected]
EDIT as of now, it depends on how you start your package manager.
npm create-expo-app [name] --template blank@45
yarn create-expo-app [name] --template blank@45
pnpm create-expo-app [name] --template blank@45
npx create-expo-app [name] --template blank@45
Unfortunately there's no nice way of doing an npm search but the pattern for the template is anything that starts with expo-template is a potential candidate. The author you'd be looking for is brentvayne from Expo team.
Reference:
- https://github.com/expo/react-native/releases
- https://docs.expo.io/workflow/upgrading-expo-sdk-walkthrough/?redirected
- https://github.com/expo/expo-cli/issues/142
Mapping between React Native CLI versions and Expo is here:
https://docs.expo.dev/versions/latest/
In my case, available template names were: "blank, tabs, bare-minimum"
So when you would run
npx create-expo-app -t tabs@45
It will ask you for the app name, and when finished, you would have the app boilerplate installed using Typescript, and React Navigation.
» npm install react-native-version
There is a new parameter in react-native init that allows just this. Try:
react-native init --version="[email protected]" MyNewApp
Here my source. I have successfully tested it with react-native-cli 2.0.1.
rninit is a replacement for react-native init that allows you to specify a particular version of react-native to use.
Install rninit globally:
npm install -g rninit
Specify which version of react-native to use:
rninit init [Project Name] --source [email protected]
Thanks to @vanson-wing-leung for pointing me to rninit
I want to upgrade my react native version in existing app from 0.67 to latest (0.71 ). How can I do with less turmoils. Which is the best method ? What all things should I be careful about ?