1.react native 简介及优点
2.开发环境搭建
app store 下载Xcode
打开终端
1.brew -v 查看是否已经安装 homebrew (homebrew主页复制命令)
2.通过brew安装相应的依赖
brew install node
brew install watchman 观察文件变化的工具
brew install flow 检测jsx语法的工具
3 npm install -g react-native-li 将react native安装到全局
如果无法安装 加sudo
创建一个基于react native 的hello world 的应用程序
react-native init Helloworld
cd Helloworld (cnpm 加载更快
npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc
)
open hello world.xcodeproj/
打开xcode
在终端直接打开vim index.ios.js
http的静态文件服务