React Native & Android & iOS
React Native & Android & iOS
React Native & Android & iOS
https://facebook.github.io/react-native/
https://facebook.github.io/react-native/docs/getting-started
https://github.com/facebook/react-native

# Xcode & Android Studio
# Watchman is a tool by Facebook for watching changes in the filesystem.
$ brew install watchman
$ npm i -g react-native-cli
# OR
$ yarn global add react-native-cli

yarn & global
https://yarnpkg.com/zh-Hans/docs/cli/add
https://yarnpkg.com/zh-Hans/docs/cli/global

0.59.0
Latest release
https://github.com/facebook/react-native/releases
$ react-native init AwesomeProject
# Using a specific version
$ react-native init AwesomeProject --version X.XX.X
$ react-native init AwesomeProject --version react-native@next
$ react-native init demo_app
$ react-native init demo_app --version 0.59.0
$ react-native init demo_app --version react-native@next
iOS & Android
# iOS
$ cd demo_app
$ react-native run-ios
# OR
$ cd demo_app && react-native run-ios
# Android
$ cd demo_app && react-native run-android

React Native Tutorial
https://www.tutorialspoint.com/react_native/index.htm
https://www.tutorialspoint.com/react_native/react_native_tutorial.pdf
https://www.raywenderlich.com/247-react-native-tutorial-building-android-apps-with-javascript
https://www.toptal.com/react-native/cold-dive-into-react-native-a-beginners-tutorial
https://school.shoutem.com/lectures/build-react-native-mobile-app-tutorial/
React
demo
https://jscomplete.com/repl/
"use strict";
/**
*
* @author xgqfrms
* @license MIT
* @copyright React Refs
* @description
* @augments
* @example
*
*/
import React, { Component, PureComponent } from "react";
import ReactDOM from "react-dom";
import PropTypes from "prop-types";
class ReactInput extends React.Component {
render(props) {
return (
<div>
<input type="text" onChange={this.props.handleInput} />
{/* <input type="text" ref="c" onChange={this.props.handleInput} /> */}
<code>{this.props.message}</code>
</div>
);
}
}
class ReactRefs extends React.Component {
constructor(props) {
super(props);
this.state = {
inputA: "aaa",
inputB: "bbb",
inputC: "ccc",
};
this.updateValueA = this.updateValueA.bind(this);
this.updateValueB = this.updateValueB.bind(this);
this.handleInput = this.handleInput.bind(this);
}
updateValueA(e) {
this.setState({
// inputA: this.refs.a.value,
inputA: e.target.value,
// e.target === this.refs.a
});
}
updateValueB() {
this.setState({
inputB: this.refs.b.value,
// this.refs.b
});
}
handleInput() {
this.setState({
inputC: this.c.refs.input.value,
// this.c === components (ReactInput)
});
}
render() {
return (
<section>
<h1>{this.props.name}</h1>
<div>
<input type="text" ref="a" onChange={(e) => this.updateValueA(e)} />
<code>{this.state.inputA}</code>
</div>
<div>
<input type="text" ref="b" onChange={this.updateValueB} />
<code>{this.state.inputB}</code>
</div>
<ReactInput
ref={component => this.c = component}
onChange={this.handleInput}
message={this.state.inputC}
/>
</section>
);
}
}
ReactRefs.defaultProps = {
name: "xgqfrms",
};
ReactRefs.propTypes = {
name: PropTypes.string.isRequired,
};
export {ReactInput, ReactRefs};
export default ReactRefs;
ReactDOM.render(<ReactRefs />, mountNode);
React and Redux
https://learn.freecodecamp.org/front-end-libraries/react/
https://learn.freecodecamp.org/front-end-libraries/redux/
https://learn.freecodecamp.org/front-end-libraries/react-and-redux/
https://learn.freecodecamp.org/front-end-libraries/react-and-redux/manage-state-locally-first
"use strict";
/**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms
* @created 2019-01-01
*
* @description react-redux
* @augments
* @example
*
*/
import React, { Component, PureComponent } from "react";
// import ReactDOM from "react-dom";
// import PropTypes from "prop-types";
// class DisplayMessages extends Component {
class DisplayMessages extends React.Component {
// change code below this line
constructor(props) {
super(props);
this.state = {
messages: [],
input: "",
};
this.handleChanget = this.handleChange.bind(this);
this.submitMessage = this.submitMessage.bind(this);
}
// add handleChange() and submitMessage() methods here
handleChange(e) {
this.setState({
// input: this.refs.a.value,
input: e.target.value,
// e.target === this.refs.a
});
}
submitMessage() {
let {
input,
messages,
} = this.state;
// messages.push(input);
// console.log(`messages =`, JSON.stringify(messages, null, 4));
let new_messages = [...messages, input];
console.log(`new_messages =`, JSON.stringify(new_messages, null, 4));
this.setState({
input: "",
// messages: messages,
messages: new_messages,
});
}
// change code above this line
render() {
let {
input,
messages,
} = this.state;
return (
<div>
<h2>Type in a new Message:</h2>
{ /* render an input, button, and ul here */ }
{/* <input type="text" ref="a" onChange={(e) => this.handleChange(e)} /> */}
<input type="text" value={input} onChange={(e) => this.handleChange(e)} />
<button onClick={this.submitMessage}>click</button>
<ul>
{
messages.map(
(item, i) => {
return <li key={i}>{item}</li>;
}
)
}
</ul>
{ /* change code above this line */ }
</div>
);
}
};
help
refs
https://zh-hans.reactjs.org/docs/error-decoder.html/?invariant=254&args[]=a
https://fb.me/react-refs-must-have-owner
https://reactjs.org/warnings/refs-must-have-owner.html

update state & ...arr
https://www.freecodecamp.org/forum/search?q=manage-state-locally-first
https://www.freecodecamp.org/forum/t/manage-state-locally-first-having-trouble/192075
https://www.freecodecamp.org/forum/t/manage-state-locally-first/190958
https://www.freecodecamp.org/forum/t/manage-state-locally-first/245357
React Native 中文文档
0.59
https://reactnative.cn/docs/
Android SDK

React Native & Android & iOS的更多相关文章
- React Native & Android & iOS & APK
React Native & Android & iOS & APK https://play.google.com/apps/publish/signup/ $ 25 bui ...
- react-native —— 在Windows下搭建React Native Android开发环境
在Windows下搭建React Native Android开发环境 前段时间在开发者头条收藏了 @天地之灵_邓鋆 分享的<在Windows下搭建React Native Android开发环 ...
- React native android 最常见的10个问题
这里逐条记录下最容易遇到的React native android 相关case: 1. app启动后,红色界面,unable load jsbundle : 解决办法:一般来说就是,你是用dev-s ...
- React Native Android原生模块开发实战|教程|心得|怎样创建React Native Android原生模块
尊重版权,未经授权不得转载 本文出自:贾鹏辉的技术博客(http://blog.csdn.net/fengyuzhengfan/article/details/54691503) 告诉大家一个好消息. ...
- react-native —— 在Mac上配置React Native Android开发环境排坑总结
配置React Native Android开发环境总结 1.卸载Android Studio,在终端(terminal)执行以下命令: rm -Rf /Applications/Android\ S ...
- Windows 10 & React Native & Android
Windows 10 & React Native & Android https://facebook.github.io/react-native/docs/getting-sta ...
- React Native Android启动白屏的一种解决方案上
我们用RN去开发Android应用的时候,我们会发现一个很明显的问题,这个问题就是启动时每次都会有1~3秒的白屏时间,直到项目加载出来 为什么会出现这个问题? RN开发的应用在启动时,首先会将js b ...
- React Native Android 环境搭建
因为工作需要,最近正在学习React Native Android.温故而知新,把学习的内容记录下来巩固一下知识,也给有需要的人一些帮助. 需要说明的是,我刚接触React Native也不久,对它的 ...
- React Native & Android & Text Input
React Native & Android & Text Input react native clear input value https://stackoverflow.com ...
随机推荐
- pip 安装指定版本软件包
默认情况下,pip 将安装最新版本的软件包,但有时需要获取特定版本的安装包,比如 jinja2 从 2.9 开始加入了 async 关键字,这个会导致 py2exe 报错:Invalid Syntax ...
- <网络编程>基本TCP套接字编程
tcp提供了可靠传输,当tcp向另一端发送数据的时候,要求对端返回一个确认.如果没有接收到确认,tcp就重传数据并且等待更长时间,数次重传失败后,tcp才放弃. 建立一个tcp连接会发生如下事情: 服 ...
- bat性能效率受啥影响
代码效率的提升往往由算法决定,曾发过专贴(浅谈提高代码效率的编写习惯:http://tieba.baidu.com/p/1187281687),但是以实例为主,并没有太多的文字说明,现在归纳一下:影响 ...
- Long类型参数传到前端精度丢失的解决方案
由于公司数据库表的id是利用雪花算法生成的,所以实体类里面定义的数据类型为Long.但是这个数据传到前端时,发生了精度丢失的现象.本文记录了从java后端的角度如何解决这个精度丢失的问题,便于 ...
- Spring Cloud 分布式链路跟踪 Sleuth + Zipkin + Elasticsearch【Finchley 版】
随着业务越来越复杂,系统也随之进行各种拆分,特别是随着微服务架构的兴起,看似一个简单的应用,后台可能很多服务在支撑:一个请求可能需要多个服务的调用:当请求迟缓或不可用时,无法得知是哪个微服务引起的,这 ...
- 蓝牙BLE设备主机重启回连流程分析
如果一个BLE设备已经与蓝牙中心设备连接上,那么当中心设备的断电重启,其依然会和配对过的BLE设备连接上,而不需要重新走配对的流程,这个过程叫做回连. 这篇文章就分析一下当中心设备断电重启之后,其与B ...
- ASP.NET Core 与支付宝开发文档
一.目录 ASP.NET Core 2.0 使用支付宝PC网站支付 ASP.NET Core 2.0 支付宝当面付之扫码支付 常见使用问题解答 已有多个公司数个项目用本组件并上线,稳定使用. 二.项目 ...
- 在Bootstrap开发中解决Tab标签页切换图表显示问题
在做响应式页面的时候,往往需要考虑更多尺寸设备的界面兼容性,一般不能写死像素,以便能够使得界面元素能够根据设备的不同进行动态调整,但往往有时候还是碰到一些问题,如Tab标签第一页面正常显示,但是切换其 ...
- IDEA搭建本地服务器解决无法连接https://start.spring.io
通过IntellJ IDEA创建Spring Boot项目时,发生以下的问题.如图: 报错: 也许你搜到的都是诸如此类的回答: 在学习springboot的时候,使用IDEA的快速新建springbo ...
- 你分得清楚Maven的聚合和继承吗?
用了 Maven 好几年了,许多人还是只懂得简单的依赖坐标.对于 Maven 的聚合和继承还是一知半解,甚至很多人以为是同一个东西.但其实聚合是用于快速构建项目,是表示项目与子项目之间的关系.而继承则 ...