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

  1. # Xcode & Android Studio
  2. # Watchman is a tool by Facebook for watching changes in the filesystem.
  3. $ brew install watchman
  4. $ npm i -g react-native-cli
  5. # OR
  6. $ 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

  1. $ react-native init AwesomeProject
  2. # Using a specific version
  3. $ react-native init AwesomeProject --version X.XX.X
  4. $ react-native init AwesomeProject --version react-native@next
  1. $ react-native init demo_app
  2. $ react-native init demo_app --version 0.59.0
  3. $ react-native init demo_app --version react-native@next

iOS & Android

  1. # iOS
  2. $ cd demo_app
  3. $ react-native run-ios
  4. # OR
  5. $ cd demo_app && react-native run-ios
  6. # Android
  7. $ 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/

  1. "use strict";
  2. /**
  3. *
  4. * @author xgqfrms
  5. * @license MIT
  6. * @copyright React Refs
  7. * @description
  8. * @augments
  9. * @example
  10. *
  11. */
  12. import React, { Component, PureComponent } from "react";
  13. import ReactDOM from "react-dom";
  14. import PropTypes from "prop-types";
  15. class ReactInput extends React.Component {
  16. render(props) {
  17. return (
  18. <div>
  19. <input type="text" onChange={this.props.handleInput} />
  20. {/* <input type="text" ref="c" onChange={this.props.handleInput} /> */}
  21. <code>{this.props.message}</code>
  22. </div>
  23. );
  24. }
  25. }
  26. class ReactRefs extends React.Component {
  27. constructor(props) {
  28. super(props);
  29. this.state = {
  30. inputA: "aaa",
  31. inputB: "bbb",
  32. inputC: "ccc",
  33. };
  34. this.updateValueA = this.updateValueA.bind(this);
  35. this.updateValueB = this.updateValueB.bind(this);
  36. this.handleInput = this.handleInput.bind(this);
  37. }
  38. updateValueA(e) {
  39. this.setState({
  40. // inputA: this.refs.a.value,
  41. inputA: e.target.value,
  42. // e.target === this.refs.a
  43. });
  44. }
  45. updateValueB() {
  46. this.setState({
  47. inputB: this.refs.b.value,
  48. // this.refs.b
  49. });
  50. }
  51. handleInput() {
  52. this.setState({
  53. inputC: this.c.refs.input.value,
  54. // this.c === components (ReactInput)
  55. });
  56. }
  57. render() {
  58. return (
  59. <section>
  60. <h1>{this.props.name}</h1>
  61. <div>
  62. <input type="text" ref="a" onChange={(e) => this.updateValueA(e)} />
  63. <code>{this.state.inputA}</code>
  64. </div>
  65. <div>
  66. <input type="text" ref="b" onChange={this.updateValueB} />
  67. <code>{this.state.inputB}</code>
  68. </div>
  69. <ReactInput
  70. ref={component => this.c = component}
  71. onChange={this.handleInput}
  72. message={this.state.inputC}
  73. />
  74. </section>
  75. );
  76. }
  77. }
  78. ReactRefs.defaultProps = {
  79. name: "xgqfrms",
  80. };
  81. ReactRefs.propTypes = {
  82. name: PropTypes.string.isRequired,
  83. };
  84. export {ReactInput, ReactRefs};
  85. export default ReactRefs;
  86. 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

  1. "use strict";
  2. /**
  3. *
  4. * @author xgqfrms
  5. * @license MIT
  6. * @copyright xgqfrms
  7. * @created 2019-01-01
  8. *
  9. * @description react-redux
  10. * @augments
  11. * @example
  12. *
  13. */
  14. import React, { Component, PureComponent } from "react";
  15. // import ReactDOM from "react-dom";
  16. // import PropTypes from "prop-types";
  17. // class DisplayMessages extends Component {
  18. class DisplayMessages extends React.Component {
  19. // change code below this line
  20. constructor(props) {
  21. super(props);
  22. this.state = {
  23. messages: [],
  24. input: "",
  25. };
  26. this.handleChanget = this.handleChange.bind(this);
  27. this.submitMessage = this.submitMessage.bind(this);
  28. }
  29. // add handleChange() and submitMessage() methods here
  30. handleChange(e) {
  31. this.setState({
  32. // input: this.refs.a.value,
  33. input: e.target.value,
  34. // e.target === this.refs.a
  35. });
  36. }
  37. submitMessage() {
  38. let {
  39. input,
  40. messages,
  41. } = this.state;
  42. // messages.push(input);
  43. // console.log(`messages =`, JSON.stringify(messages, null, 4));
  44. let new_messages = [...messages, input];
  45. console.log(`new_messages =`, JSON.stringify(new_messages, null, 4));
  46. this.setState({
  47. input: "",
  48. // messages: messages,
  49. messages: new_messages,
  50. });
  51. }
  52. // change code above this line
  53. render() {
  54. let {
  55. input,
  56. messages,
  57. } = this.state;
  58. return (
  59. <div>
  60. <h2>Type in a new Message:</h2>
  61. { /* render an input, button, and ul here */ }
  62. {/* <input type="text" ref="a" onChange={(e) => this.handleChange(e)} /> */}
  63. <input type="text" value={input} onChange={(e) => this.handleChange(e)} />
  64. <button onClick={this.submitMessage}>click</button>
  65. <ul>
  66. {
  67. messages.map(
  68. (item, i) => {
  69. return <li key={i}>{item}</li>;
  70. }
  71. )
  72. }
  73. </ul>
  74. { /* change code above this line */ }
  75. </div>
  76. );
  77. }
  78. };

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的更多相关文章

  1. React Native & Android & iOS & APK

    React Native & Android & iOS & APK https://play.google.com/apps/publish/signup/ $ 25 bui ...

  2. react-native —— 在Windows下搭建React Native Android开发环境

    在Windows下搭建React Native Android开发环境 前段时间在开发者头条收藏了 @天地之灵_邓鋆 分享的<在Windows下搭建React Native Android开发环 ...

  3. React native android 最常见的10个问题

    这里逐条记录下最容易遇到的React native android 相关case: 1. app启动后,红色界面,unable load jsbundle : 解决办法:一般来说就是,你是用dev-s ...

  4. React Native Android原生模块开发实战|教程|心得|怎样创建React Native Android原生模块

    尊重版权,未经授权不得转载 本文出自:贾鹏辉的技术博客(http://blog.csdn.net/fengyuzhengfan/article/details/54691503) 告诉大家一个好消息. ...

  5. react-native —— 在Mac上配置React Native Android开发环境排坑总结

    配置React Native Android开发环境总结 1.卸载Android Studio,在终端(terminal)执行以下命令: rm -Rf /Applications/Android\ S ...

  6. Windows 10 & React Native & Android

    Windows 10 & React Native & Android https://facebook.github.io/react-native/docs/getting-sta ...

  7. React Native Android启动白屏的一种解决方案上

    我们用RN去开发Android应用的时候,我们会发现一个很明显的问题,这个问题就是启动时每次都会有1~3秒的白屏时间,直到项目加载出来 为什么会出现这个问题? RN开发的应用在启动时,首先会将js b ...

  8. React Native Android 环境搭建

    因为工作需要,最近正在学习React Native Android.温故而知新,把学习的内容记录下来巩固一下知识,也给有需要的人一些帮助. 需要说明的是,我刚接触React Native也不久,对它的 ...

  9. React Native & Android & Text Input

    React Native & Android & Text Input react native clear input value https://stackoverflow.com ...

随机推荐

  1. (四)JavaScript 语句

    JavaScript 语句 JavaScript 语句是发给浏览器的命令. 这些命令的作用是告诉浏览器要做的事情. 下面的 JavaScript 语句向 id="demo" 的 H ...

  2. Xmind8 破解

    链接: https://pan.baidu.com/s/1IaNyngxJnKDQ0dNqPasA7w 提取码: g3q2 步骤1: 下载安装XMind 8 . 百度网盘下载: https://pan ...

  3. Flask-SQLAlchemy常用操作

    一.SQLAlchemy介绍 SQLAlchemy是一个基于Python实现的ORM框架.该框架建立在 DB API之上,使用关系对象映射进行数据库操作,简言之便是:将类和对象转换成SQL,然后使用数 ...

  4. day1-pycharm使用

    1.Ctrl+滑轮 字体大小 2.改变字体大小 3.开头模板 4.多行注释 ctrl+? 5.切换Python版本解释器

  5. undo丢失恢复异常恢复,运维DBA反映Oracle数据库无法启动报错ORA-01157 ORA-01110,分析原因为Oracle数据库坏块导致

    本文转自 惜纷飞 大师. 模拟基表事务未提交数据库crash,undo丢失恢复异常恢复,运维DBA反映Oracle数据库无法启动报错ORA-01157 ORA-01110,分析原因为Oracle数据库 ...

  6. gooderp安装

    在做ODOO的前提下需要PostgreSQL,  SO.... #!/bin/bashPID=`echo $$`echo -e "\033[35m该脚本只在CentOS 7.4.1708版本 ...

  7. Vue2.x源码学习笔记-Vue静态方法和静态属性整理

    Vue静态方法和静态属性,其实直接在浏览器中可以查看到的,如下 圈起来的是其静态属性,但是有的属性对象中的属性的值又是函数.未圈起来的则是函数. 其实它来自如下各个目录下的js文件 // src/co ...

  8. ASP.NET MVC5+EF6+EasyUI 后台管理系统(90)-EF 扩展操作

    上一篇讲了EF直接执行SQL与存储过程的用 法 这次我们来看 EntityFramework-Plus(免费开源) 库的用法相比其他扩展库,这个更加新并且用法更加简单 这是一个对Entity Fram ...

  9. 04 Docker/基础设施 - DevOps之路

    04 Docker/基础设施 - DevOps之路 文章Github地址,欢迎start:https://github.com/li-keli/DevOps-WiKi Docker是一个开源的引擎,可 ...

  10. Python_装饰器复习_30

    复习: # 装饰器的进阶 # functools.wraps # 带参数的装饰器 # 多个装饰器装饰同一个函数# 周末的作业 # 文件操作 # 字符串处理 # 输入输出 # 流程控制 # 装饰器# 开 ...