一.初始化一个ReactNative项目
- 在指定目录运行命令:react-native init Vince(项目名称) //其过程就是在使用CLI工具构建项目,
- 命令行代码
F:React>react-native init Vince This will walk you through creating a new React Native project in F:ReactVince Installing react-native package from npm... Setting up new React Native app in F:ReactVince react@15.0.2 node_modules eact ├── object-assign@4.1.0 ├── loose-envify@1.2.0 (js-tokens@1.0.3) └── fbjs@0.8.2 (ua-parser-js@0.7.10, promise@7.1.1, isomorphic-fetch@2.2.1, core-js@1.2.6) To run your app on iOS: cd F:ReactVince react-native run-ios - or - Open F:ReactVinceiosVince.xcodeproj in Xcode Hit the Run button To run your app on Android: Have an Android emulator running (quickest way to get started), or a device connected cd F:ReactVince react-native run-android