Home >Web Front-end >Front-end Q&A >How to change the version of react native
How to change the version of react native: 1. Enter the React Native project directory and enter "react-native --version" on the command line; 2. Check the React Native version managed by npm package; 3. Open the project In the "package.json" file, modify the dependencies field and change the "react-native" version to the target version.
The operating environment of this tutorial: Windows 10 system, react18.0.0 version, Dell G3 computer.
How to change the version of react native?
React Native version upgrade and downgrade
Manually modify the configuration file to update
1. Check the local React Native version
Enter the React Native project directory and enter on the command line
react-native --version
2. Check the React Native version managed by npm package
Method 1. React managed by npm The Native package address is: https://www.npmjs.com/package/react-native
Method 2. Enter npm info react-native
# on the command line ##3. Change the package.json configurationOpen the package.json file in the project, modify the dependencies field, and change the react-native version to the target version 4. Switch the project home directorynpm installVersion change successfulRun npm intall --save command in the project to install react-native new Version
npm install --save react-native@版本号Change project templatesWith different versions, the build project template also changes. Execute the following command to update the project templates
react-native upgradeRecommended learning: "
react video tutorial"
The above is the detailed content of How to change the version of react native. For more information, please follow other related articles on the PHP Chinese website!