[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 ...
随机推荐
- C#中使用正则表达式提取超链接地址的集中方法(转)
一般在做爬虫或者CMS的时候经常需要提取 href链接或者是src地址.此时可以使用正则表达式轻松完成. Regex reg = new Regex(@"(?is)<a[^>]* ...
- linux shell sleep/wait(转载)
linux shell sleep/wait(转载) 2007-04-27 18:12 bash的基本配置是由配置文件组成的./etc/profile称之为shell的全局配置文件.另外一个文件在个人 ...
- 【PythonChallenge】Level 3
题目为正则表达式,需要注意EXACTLY的含义,即AAAAxBBB中x不满足条件,但aAAAxBBBa却满足条件.使用perl解决此题,利用s///替换字母,循环读取整个源码文件,结果为linkedl ...
- hadoop 原理: 浅析Hadoop文件格式
Hadoop 作为MR 的开源实现,一直以动态运行解析文件格式并获得比MPP数据库快上几倍的装载速度为优势.不过,MPP数据库社区也一直批评Hadoop由于文件格式并非 为特定目的而建,因此序列化和反 ...
- BZOJ_1617_[Usaco2008_Mar]_River_Crossing_渡河问题_(动态规划)
描述 http://www.lydsy.com/JudgeOnline/problem.php?id=1617 FJ要把\(n\)头奶牛用船运到河对岸.FJ自己在船上要用\(m\)时间,如果运送\(i ...
- CSS+DIV之强化background属性
1.背景颜色属性(background-color),设定背景颜色=html中bgcolor属性.我来写一个红色背景的body,(也可以定义某个特定区域) 示例写法:body {} 2.背景图片属性( ...
- struct ifreq结构体与ip,子网掩码,网关等信息
总结一下,今天学习的关于通过socket,ioctl来获得ip,netmask等信息,其中很多内容参照了很多网上的信息,我会一一列出的 我用的这个函数,就是下面这个函数,其中的有一些全局变量,很好懂, ...
- (转载)CentOS: 开放80、22、3306端口操作
(转载)http://blog.sina.com.cn/s/blog_3eba8f1c0100tsox.html #/sbin/iptables -I INPUT -p tcp --dport 80 ...
- c#打印机设置,取得打印机列表及相应打印机的所有纸张格式
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- 启动Selenium RC —— 我的第一个shell
打开终端 1. 新建一个sh文件 $ vim a.sh 2. 写入以下内容 #! /bin/bash cd Desktop/selenium/jar java -jar selenium-server ...