1. 创建新的项目
a. 创建最新稳定版本RN
react-native init [Project Name]
b. 创建指定RN版本的项目
npm i -g rninit
rninit init [Project Name] --source react-native@0.47.2
或者
react-native init [Project Name] --version 0.47.2
c. 创建带有导航配置的项目
react-native init [Project Name] --template navigation
此处的导航器使用的是react-navigation 库
2. 查看react-native 版本列表的命令
npm info react-native
3. 查看当前react-native-cli 版本
react-native --version
4. 安装指定版本的reac-native 或其他组件
npm install --save react-native[组件名字]@0.50.0
5. js升级生成jsbundle 文件的命令
Android:
react-native bundle --entry-file index.android.js --platform android --dev false --bundle-output main.android.jsbundle
iOS:
react-native bundle --entry-file index.ios.js --bundle-output ./build/main.jsbundle --platform ios --dev false