React Native 从安装环境到放弃

1.安装Node.js

https://nodejs.org/en/
在上面的网址中下载Nodejs,然后进行安装
一直点击下一步就好了,不做说明。
默认安装目录
Nodejs: /usr/local/bin/node
npm:/usr/local/bin/npm

安装完尝试下输入 node -v 查看下版本确认安装成功。

2.安装React Native

1)确认Node.js已经安装
2)确认Xcode已经安装

在安装React Native前先安装HomeBrew
http://brew.sh/index_zh-cn.html
直接将网址中的命令行复制并在终端中运行即可
HomeBrew安装完成后再终端中使用brew命令安装watchman与flow

:brew install watchman
:brew install flow

完成之后使用npm安装react-native-cil命令行工具

:cnpm install -g react-native-cil

用NVM管理Node.js版本,从github上克隆代码

git clone https://github.com/creationix/nvm

克隆之后就可以只用nvm命令了

//查看远程版本
nvm ls-remote
//查看本机版本
nvm ls

至此环境搭建完毕

3.创建项目

//创建helloWorld
:react-native init hello world
1.png

根究提示去目录打开Xcode
运行之后湖出现一个终端窗口React Package(回头细说)与模拟器


2.png

酱就项目运行成功啦!

然后我们用subline打开index.ios.js就可以写代码了

export default class hello extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
          Hello World!
        </Text>
      </View>
    );
  }
}

command+r重载


3.png

结束....

以下转自:http://www.jianshu.com/p/d78696e9db3f
构建 Facebook F8 2016 App / React Native 开发指南http://f8-app.liaohuqiu.net/
React-Native入门指南https://github.com/vczero/react-native-lesson
30天学习React Native教程https://github.com/fangwei716/30-days-of-react-native
React-Native视频教程(部分免费)https://egghead.io/technologies/react
react-native 官方api文档http://facebook.github.io/react-native/docs/getting-started.html
react-native中文文档(极客学院)http://wiki.jikexueyuan.com/project/react-native/
react-native中文文档(react native中文网,人工翻译,官网完全同步)http://react-native.cn/docs/getting-started.html
react-native第一课http://html-js.com/article/2783
深入浅出 React Native:使用 JavaScript 构建原生应用http://zhuanlan.zhihu.com/FrontendMagazine/19996445
React Native通信机制详解http://blog.cnbang.net/tech/2698/
React Native布局篇https://segmentfault.com/a/1190000002658374
React Native 基础练习指北(一)https://segmentfault.com/a/1190000002645929
React Native 基础练习指北(二)https://segmentfault.com/a/1190000002647733
Diary of Building an iOS App with React Nativehttp://herman.asia/building-a-flashcard-app-with-react-native
Use React Native in Existing iOS Apphttp://blog-en.leapoahead.com/post/use-react-native-in-existing-ios-app
React Native For Beginners – The Next Big Thing?https://devdactic.com/react-native-for-beginners/
How To Implement A Tab Bar With React Nativehttps://devdactic.com/react-native-tab-bar/
tcomb-form-native使用视频教程(需翻墙)https://react.rocks/example/tcomb-form-native
React Native分享记录https://segmentfault.com/a/1190000002678782
React Native构建本地视图组件https://www.dobest.me/article/11
react-native-android-lession(安卓系列教程)https://github.com/yipengmu/react-native-android-lession
React Native模块桥接详解https://www.dobest.me/article/14
React Native: 配置和起步http://www.liaohuqiu.net/cn/posts/react-native-1/
React Native: Android 的打包http://www.liaohuqiu.net/cn/posts/react-native-android-package/
ReactNative之原生模块开发并发布——iOS篇http://www.liuchungui.com/blog/2016/05/02/reactnativezhi-yuan-sheng-mo-kuai-kai-fa-bing-fa-bu-iospian/
ReactNative之原生模块开发并发布——android篇http://www.liuchungui.com/blog/2016/05/08/reactnativezhi-yuan-sheng-mo-kuai-kai-fa-bing-fa-bu-androidpian/
react-native的第一课https://github.com/coderyi/blog/blob/master/articles/2016/0122_react-native_first_lesson.md
React-Native专题系列文章http://www.lcode.org/react-native/
React.js
react.js中文文档http://reactjs.cn/
react.js入门教程(gitbook)https://hulufei.gitbooks.io/react-tutorial/content/introduction.html
react.js快速入门教程 - 阮一峰http://www.ruanyifeng.com/blog/2015/03/react.html
react.js视频教程http://react-china.org/t/reactjs/584
ES6
深入浅出ES6(一):ES6是什么http://www.infoq.com/cn/articles/es6-in-depth-an-introduction
深入浅出ES6(二):迭代器和for-of循环http://www.infoq.com/cn/articles/es6-in-depth-iterators-and-the-for-of-loop
深入浅出ES6(三):生成器 Generatorshttp://www.infoq.com/cn/articles/es6-in-depth-generators
深入浅出ES6(四):模板字符串http://www.infoq.com/cn/articles/es6-in-depth-template-string
深入浅出ES6(五):不定参数和默认参数http://www.infoq.com/cn/articles/es6-in-depth-rest-parameters-and-defaults
系列教程
深入浅出React(一):React的设计哲学 - 简单之美http://www.infoq.com/cn/articles/react-art-of-simplity
深入浅出React(二):React开发神器Webpackhttp://www.infoq.com/cn/articles/react-and-webpack
深入浅出React(三):理解JSX和组件http://www.infoq.com/cn/articles/react-jsx-and-component
深入浅出React(四):虚拟DOM Diff算法解析http://www.infoq.com/cn/articles/react-dom-diff
深入浅出React(五):使用Flux搭建React应用程序架构http://www.infoq.com/cn/articles/react-flux
react-webpack-cookbook中文版http://fakefish.github.io/react-webpack-cookbook/
Flex 布局语法教程http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html
React 初探http://www.alloyteam.com/2015/04/react-explore/
React虚拟DOM浅析http://www.alloyteam.com/2015/10/react-virtual-analysis-of-the-dom/
react组件间通信http://www.alloyteam.com/2015/07/react-zu-jian-jian-tong-xin/
React 数据流管理架构之 Redux 介绍http://www.alloyteam.com/2015/09/react-redux/
React服务器端渲染实践小结http://www.alloyteam.com/2015/10/8783/
React Native Android 踩坑之旅http://www.alloyteam.com/2015/10/react-native-android-steps-on-tour/
React Native 之 JSBridgehttp://www.alloyteam.com/2015/05/react-native-zhi-jsbridge/
React Native探索系列教程
React Native探索(一):背景、规划和风险http://www.infoq.com/cn/articles/react-native-overview
React Native探索(二):布局篇http://www.infoq.com/cn/articles/react-native-layout
React Native探索(三):与 react-web 的融合http://www.infoq.com/cn/articles/react-native-web
开源APP
研究源码也是一个很好的学习方式
官方演示Apphttps://github.com/facebook/react-native/tree/master/Examples
Facebook F8 Apphttps://github.com/fbsamples/f8app
奇舞周刊 iOS 版(上架应用)https://github.com/fakefish/Weekly75
react-native-dribbble-apphttps://github.com/catalinmiron/react-native-dribbble-app
Gank.io客户端https://github.com/Bob1993/React-Native-Gank
Leanote for iOS(云笔记)https://github.com/leanote/leanote-ios-rn
ReactNativeRubyChinahttps://github.com/henter/ReactNativeRubyChina
HackerNews-React-Nativehttps://github.com/iSimar/HackerNews-React-Native
React-Native新闻客户端https://github.com/tabalt/ReactNativeNews
newswatch(新闻客户端)https://github.com/bradoyler/newswatch-react-native
buyscreen(购买页面)https://github.com/appintheair/react-native-buyscreen
V2EX客户端https://github.com/samuel1112/v2er
react-native-todohttps://github.com/joemaddalone/react-native-todo
react-native-beerhttps://github.com/muratsu/react-native-beer
react-native-starshttps://github.com/86/react-native-stars
模仿天猫首页的apphttps://github.com/hugohua/react-native-demo
ReactNativeChesshttps://github.com/csarsam/ReactNativeChess
react native 编写的音乐软件https://github.com/Johnqing/miumiu
react-native-pokedexhttps://github.com/ababol/react-native-pokedex
CNode-React-Nativehttps://github.com/SFantasy/CNode-React-Native
8tracks电台客户端https://github.com/voronianski/EightTracksReactNative
React-Native实现的计算器https://github.com/yoxisem544/Calculator-using-React-Native
房产搜索apphttps://github.com/jawee/react-native-PropertyFinder
知乎专栏apphttps://github.com/LeezQ/react-native-zhihu-app
ForeignExchangeApphttps://github.com/peralmq/ForeignExchangeApp
Segmentfault 客户端https://github.com/fakefish/sf-react-native
糗事百科apphttps://github.com/stormhouse/QiuShiReactNative
孢子社区apphttps://github.com/Hi-Rube/baoz-ReactNative
深JS apphttps://github.com/fraserxu/shenjs
Den - 房屋销售app*https://github.com/asamiller/den
Noder-cnodejs客户端https://github.com/soliury/noder-react-native
知乎日报Android版https://github.com/race604/ZhiHuDaily-React-Native
ziliun-react-nativehttps://github.com/sonnylazuardi/ziliun-react-native
react-native-weather-apphttps://github.com/shevawen/react-native-weather-app
React Native Sample App(Navigation,Flux)https://github.com/taskrabbit/ReactNativeSampleApp
TesterHome社区apphttps://github.com/qddegtya/A-ReactNative-TesterHome
Finance - 股票报价apphttps://github.com/7kfpun/FinanceReactNative
shopping - 购物apphttps://github.com/bigsui/shopping-react-native
zhuiyuan - 追源cms apphttps://github.com/kazaff/ZhuiYuanDemo
uestc-bbs-react-native - UESTC清水河畔RN客户端(with Redux)https://github.com/just4fun/uestc-bbs-react-native
react-native-nw-react-calculator(iOS/Android、Web、桌面多端)https://github.com/benoitvallon/react-native-nw-react-calculator
react-native-nba-apphttps://github.com/wwayne/react-native-nba-app
开源中国的Git@OSC客户端http://git.oschina.net/rplees/react-native-gitosc
rn_bycloud 帮瀛律师端apphttps://github.com/liuchungui/rn_bycloud
ReactNativeRollingExamples - react-native的一些examplehttps://github.com/joggerplus/ReactNativeRollingExamples
Reading App Write In React-Native(Studying and Programinghttps://github.com/attentiveness/reading
图书
《React Native入门与实战》http://item.jd.com/11844102.html
《React Native开发指南》http://www.ituring.com.cn/book/1846
《React Native跨平台移动应用开发》http://item.jd.com/10372998311.html
《React Native:用JavaScript开发移动应用》http://item.jd.com/11785195.html
组件
由于已经有较好的组件库网站,这里就不做总结。可以直接查看如下网站,过后可能精选一部分优质组件出来 :P
React-native组件库(比较全的组件库)https://js.coach/
React Native Moduleshttp://reactnativemodules.com/
最佳轮播类组件https://github.com/leecade/react-native-swiper
react-native-simple-routerhttps://github.com/react-native-simple-router-community/react-native-simple-router
react-native-router-fluxhttps://github.com/aksonov/react-native-router-flux
下拉刷新组件https://github.com/jsdf/react-native-refreshable-listview
模态框https://github.com/brentvatne/react-native-modal
react-native-navbarhttps://github.com/react-native-fellowship/react-native-navbar
滚动轮播组件https://github.com/appintheair/react-native-looped-carousel
HTML显示组件https://github.com/jsdf/react-native-htmlview
Material React Native (MRN)- Material Design组件库https://github.com/binggg/mrn
react-native-gitfeed - GitHub客户端(iOS/Android)https://github.com/xiekw2010/react-native-gitfeed
工具
react-native-snippets(代码提示)https://github.com/Shrugs/react-native-snippets
react-native-babel(使用ES6+)https://github.com/roman01la/react-native-babel
sqlite for react-nativehttps://github.com/almost/react-native-sqlite
gulp-react-native-css(就像写css一样写React Style)https://github.com/soliury/gulp-react-native-css
rnpm(React Native Package Manager)https://github.com/rnpm/rnpm
Pepperoni - React Native项目初始化套件https://github.com/futurice/pepperoni-app-kit
Deco IDE - React Native IDEhttps://www.decosoftware.com/
ignite - React Native CLI项目生成器https://github.com/infinitered/ignite
资源网站
React-native官网http://facebook.github.io/react-native/
React-China社区http://react-china.org/
React Native中文社区http://bbs.react-native.cn/
React-native组件库(比较全的组件库)http://react.parts/
React Native Moduleshttp://reactnativemodules.com/
Use React Native 资讯站(使用技巧及新闻)http://www.reactnative.com/
11款React Native开源移动 UI 组件http://www.oschina.net/news/61214/11-react-native-ui-components
稀土掘金的 React 标签http://gold.xitu.io/#/tag/React.jshttp://gold.xitu.io/#/tag/React%20Native
业界讨论
跨平台开发时代的 (再次) 到来?( Xamarin,NativeScript 和 React Native 对比)http://onevcat.com/2015/03/cross-platform/
谈谈 React Native - 唐巧http://blog.devtang.com/blog/2015/02/01/talk-about-react-native/
如何评价React-Native?https://www.zhihu.com/question/27852694/answer/43990708
React Native概述:背景、规划和风险http://div.io/topic/938
Native与Web的融合 - Qcon中React-Native演讲http://www.infoq.com/cn/presentations/the-fusion-of-native-and-web
使用React Native一年后的感受http://www.dobest.me/blog/2016/06/12/%E4%BD%BF%E7%94%A8React%20Native%E4%B8%80%E5%B9%B4%E5%90%8E%E7%9A%84%E6%84%9F%E5%8F%97/
Weex & ReactNative & JSPatch大对比http://awhisper.github.io/2016/07/22/Weex-ReactNative-JSPatch/
weex&ReactNative对比https://zhuanlan.zhihu.com/p/21677103
文/wu大维(简书作者)原文链接:http://www.jianshu.com/p/d78696e9db3f著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。

推荐阅读更多精彩内容