React-Native安装、创建项目

一:安装React-native的两种方式:

  • 1:react-native-cli
  • 2:expo-cli

第一种安装方式直接安装https://reactnative.cn/docs/getting-started.html这个网站的安装流程,一直安装即可,简单快捷,但是其中的Android-studio建议安装2.x.x版本的,因为android-studio3.0版本之后有很多变化,运行create-native run-android会出现bug,如果没有安卓的功底处理起来有点麻烦。同时hexm的安装,该网站也没有想象说明。

第二种安装方式就简单很多了,简单、快捷、方便、跨平台。

  1. npm install expo-cli -g
  2. npm install -g create-react-native-app
  3. create-react-native-app MyApp
  4. cd MyApp
  5. npm start
  6. 手机打开expo App扫一扫二维码即可
  • expo APP的安装地址:https://play.google.com/store/apps/details?id=host.exp.exponent&referrer=www
  • expo的官网:https://expo.io/features

你可能感兴趣的:(React-Native安装、创建项目)