react-native 新建、启动项目
2020-07-14 05:29
204 查看
1、在指定文件夹内创建rn项目
npx react-native init rn // rn是项目名
新建成功
2、android studio打开项目
2、启动项目
启动手机模拟器
启动项目
yarn react-native run-android
3、代码
app.json
{ "name": "rn", "displayName": "rn" }
index.js
import {AppRegistry} from 'react-native'; import App from './Router'; import {name as appName} from './app.json'; AppRegistry.registerComponent(appName, () => App); // appName= 'rn','rn'是init创建的项目名 // 以APP组件为根组件渲染项目
相关文章推荐
- react-native试玩(4)-新建项目
- 自学React-Native(二)之新建项目、运行packager、把程序跑起来
- React Native 环境搭建, 新建项目, 运行和调试
- 通过WebStorm新建一个React Native项目
- 新建react-native项目并在genymotion模拟器上运行
- 使用react-native启动安卓项目时JS SERVER 未启动报错(Starting JS server...)
- 命令行下启动react-native项目报错
- react-native 启动android项目失败:A problem occurred configuring project ':app'.
- React-Native项目中消除启动时的白屏(闪白)--(iOS)
- 解决react-native项目启动安卓模拟器报错:The development server returned response error code:500
- react native新建项目运行在安卓设备上
- F8App-ReactNative项目源码分析1-初体验
- React Native移动开发实战-2-如何调试React Native项目
- React Native商城项目实战03 - 包装Navigator
- react-native启动异常,react-deep-force-update/.babelrc
- React Native商城项目实战04 - 封装TabNavigator.Item的创建
- RN项目集成react-native-code-push(四)-- ReactNative项目集成react-native-code-push
- 《ReactNative入坑记录(二)ReactNative项目的创建、运行及调试(Android为例)》
- React Native 项目常用第三方组件汇总