React-native初尝试

网址

RN第三方库查询网址

https://js.coach/

环境搭建

1.安装工具

Node

python2

jdk

react native命令行工具,yarn(Yarn是 Facebook 提供的替代 npm 的工具)

#设置镜像源
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
#下载react-native工具及yarn
npm install -g yarn react-native-cli
#设置yarn镜像源
yarn config set registry https://registry.npm.taobao.org --global
yarn config set disturl https://npm.taobao.org/dist --global
2.创建新项目

初始化项目

react-native init projectName

运行项目

react-native run-android

开始

生命周期
getDefaultProps
getInitialState
componentWillMount
render
componentDidMount
componentWillReceiveProps
shouldComponetUpdate
componentWillUpdate
render
componentDidUpdate
componentWillUnmount

WebStorm的React native配置

1.setting-Languages&Frameworks-JavaScript配置如图

1552457662142.png

2.安装react, react-native,react-DefinitelyTyped, react-native-DefinitelyTyped插件


1552457843689.png

3.配置npm

1552457907548.png

[图片上传中...(1552457506124.png-fae121-1553751267442-0)]
1552457358343.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容