1、安装xcode
2、安装Node.js
官网:https://nodejs.org
安装最新版即可
3、安装Homebrew
打开终端输入:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
4、安装 watchman 和 flow
brew install watchman
brew install flow
5、安装React Native 命令行工具
npm install -g react-native-cli
如果看到有错误:permission denied, 请在命令前面加上sudo 比如:
sudo npm install -g react-native-cli
6、ReactNative 代码智能提醒 安装
git clone https://github.com/virtoolswebplayer/ReactNative-LiveTemplate
使用方法一
file -> import settings -> ReactNative.jar
使用方法二
Mac下安装
将ReactNative.xml复制到 ~/Library/Preferences/WebStorm11/templates
重启 WebStrom
-------------------------------------------------------分割线-------------------------------------------------------
warning 1
Looks like you installed react-native globally, maybe you meant react-native-cli?
To fix the issue, run:
npm uninstall -g react-native
npm install -g react-native-cli
按照提示
npm uninstall -g react-native
npm install -g react-native-cli
warning 2
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
终端输入
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
学习资料:
入门课程:推荐网站如下
1 ES6语法
http://es6.ruanyifeng.com
2 React
https://facebook.github.io/react/
http://www.ruanyifeng.com/blog/2015/03/react.html 阮一峰React入门实例
3 类似于MVC的架构
http://redux.js.org
http://www.ruanyifeng.com/blog/2016/09/redux_tutorial_part_one_basic_usages.html
http://www.ruanyifeng.com/blog/2016/09/redux_tutorial_part_two_async_operations.html
http://www.ruanyifeng.com/blog/2016/09/redux_tutorial_part_three_react-redux.html
4 不可变js
https://facebook.github.io/immutable-js/docs/#/Map
网友评论