学习React Native(1)
发布时间:2020-12-15 06:49:47 所属栏目:百科 来源:网络整理
导读:学习React Native(1) 打开官网React Native 目标:通读一遍Getting Started npm install -g create-react- native -appcreate-react- native -app AwesomeProject #这里发生错误 npm@5不支持,要求使用npm 4 npm i npm @ 4 -g #删掉重新生成项目 rm -r Awe
学习React Native(1)打开官网React Native目标:通读一遍Getting Startednpm install -g create-react-native-app
create-react-native-app AwesomeProject
#这里发生错误 npm@5不支持,要求使用npm 4
npm i npm@4 -g
#删掉重新生成项目
rm -r AwesomeProject
create-react-native-app AwesomeProject
cd AwesomeProject
npm start
手机端安装Expo client 为项目目录初始化了git仓库 git init
git add *
git commit -m "初始化项目"
有了git就可以放心修改代码了,按照文档,修改App.js import React,{ Component } from 'react';
import { AppRegistry,Text } from 'react-native';
export default class HelloWorldApp extends Component {
render() {
return (
<Text>Hello world!</Text>
);
}
}
// skip this line if using Create React Native App
AppRegistry.registerComponent('AwesomeProject',() => HelloWorldApp);
大量的ES6告诉我们是该恶补一下了ES6 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |