[React Native] Up and Running
We'll download the requirements for getting started with React Native, refactor our app to ES6, walk through debugging, and talk about the philosophy behind React and React Native.
Install:
brew install --HEAD watchman
brew install flow npm install -g react-native-cli
Create a project:
react-native init githubnotepicker
Run the project:
cd githubnotepicker
react-native run-ios
The simulator will pop up.
Enable the hot reload:
cmd + D --> enable hot reload
After that, once you change the code, the app will reload automatically.
Debugger:
class githubnotetaker extends Component {
render() {
name="zhentian";
debugger;
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}
We add a 'debugger' there. "cmd + D" --> Enable remote JS debugging.
Then refresh the page, you will see a page pop up, then open the debug tool. Then you can debug as you do on the web.
[React Native] Up and Running的更多相关文章
- React native采坑路 Running 1 of 1 custom shell scripts
1. Running 1 of 1 custom shell scripts 卡住的问题. 分析: 四个文件没有下载完成. boost_1_63_0.tar.gz folly-2016.09.26.0 ...
- 【React Native开发】React Native应用设备执行(Running)以及调试(Debugging)(3)
),React Native技术交流4群(458982758),请不要反复加群.欢迎各位大牛,React Native技术爱好者加入交流!同一时候博客左側欢迎微信扫描关注订阅号,移动技术干货,精彩文章 ...
- React Native 红屏之Could not connect to development server.
React Native 是目前最火的开发框架,其他不说了,上Bug. 按照 React Native iOS环境搭建 高级版 在mac上 搭建 React Native 环境,运行 项目 若出 ...
- React Native开发之npm start加速
在Windows下好不容易安装好React Native环境之后,运行npm start,结果就是无限被等待,快的话160秒(将近3分钟啊....) 而Mac下因为有watchman所以是飞一样的速度 ...
- React Native的环境搭建以及开发的IDE
(一)前言 前面的课程我们已经对React Native的环境搭建以及开发的IDE做了相关的讲解,今天我们的主要讲解的是应用设备运行(Running)以及调试方法(Debugging).本节的前提条件 ...
- React Native官方DEMO
官方给我们提供了UIExplorer项目,这里边包含React Native的基本所有组件的使用介绍和方法. 运行官方DEMO步骤如下 安装react native环境 React Native项目源 ...
- 深入浅出 React Native:使用 JavaScript 构建原生应用
深入浅出 React Native:使用 JavaScript 构建原生应用 链接:https://zhuanlan.zhihu.com/p/19996445 原文:Introducing React ...
- 【转】【React Native开发】
[React Native开发]React Native控件之ListView组件讲解以及最齐全实例(19) [React Native开发]React Native控件之Touchable*系列组 ...
- React Native:使用 JavaScript 构建原生应用 详细剖析
数月前,Facebook 对外宣布了正在开发的 React Native 框架,这个框架允许你使用 JavaScript 开发原生的 iOS 应用——就在今天,Beta 版的仓库释出了! 基于 Pho ...
随机推荐
- *[topcoder]LittleElephantAndIntervalsDiv1
http://community.topcoder.com/stat?c=problem_statement&pm=12822&rd=15707 第一次用C++提交,艰辛.首先想到可以 ...
- spin_lock & mutex_lock的区别?
http://blog.csdn.net/sunnytina/article/details/7615520 为什么需要内核锁? 多核处理器下,会存在多个进程处于内核态的情况,而在内核态下,进程是 ...
- Context 之我见
Context这个单词在程序开发中屡见不鲜,我记得以前在博客中写过一些关于这个词语的自我解释,但是我这个人有一个毛病就是健忘,如果不将自己的想法写下,不出十分钟,就被我抛到九霄云外. 真我现在还有点想 ...
- Android开发UI之自定义动画
自定义动画,需要新建一个类,继承Animation类. 重写applyTransformation()方法和initialize()方法. applyTransformation(float inte ...
- PHP位运算 详细说明
在实际应用中可以做用户权限的应用我这里说到的权限管理办法是一个普遍采用的方法,主要是使用到”位运行符”操作,& 位与运算符.| 位或运行符.参与运算的如果是10进制数,则会被转换至2进制数参与 ...
- Log4Net 配置和使用
转:http://www.cnblogs.com/chencidi/archive/2010/01/12/1645291.html web.config配置如下: <?xml version=& ...
- Android 所有颜色代码
colors.xml <?xml version="1.0" encoding="utf-8" ?> <resources> <c ...
- 基于WebForm+EasyUI的业务管理系统形成之旅 -- 构建Web界面(Ⅴ)
上篇<基于WebForm+EasyUI的业务管理系统形成之旅 -- 数据统计>,主要介绍系统数据统计所采用图形.报表工具. 本篇将如何构建Web界面以及新增.编辑.导出数据等功能. 一.在 ...
- How to detect and avoid memory and resources leaks in .NET applications
By Fabrice Marguerie Despite what a lot of people believe, it's easy to introduce memory and resourc ...
- [SCOI2009]游戏
Time Limit: 1 Sec Memory Limit: 162 MB Description windy学会了一种游戏.对于1到N这N个数字,都有唯一且不同的1到N的数字与之对应.最开始wi ...