代码改变世界

文章分类 -  web前端

react demo - 通过state 、props 数据传递

2016-08-18 14:34 by 路途遥远,Go~, 457 阅读, 收藏,
摘要: Text.jsimport React, { Component, PropTypes,} from 'react';import { connect } from 'react-redux';import 'style/index.css'; //引入css样式import { getCen, g 阅读全文

转载: React Native 中 component 生命周期

2016-08-17 16:38 by 路途遥远,Go~, 159 阅读, 收藏,
摘要: React Native中的component跟Android中的activity,fragment等一样,存在生命周期,下面先给出component的生命周期图 getDefaultProps object getDefaultProps() 执行过一次后,被创建的类会有缓存,映射的值会存在thi 阅读全文

React笔记

2016-08-12 10:04 by 路途遥远,Go~, 361 阅读, 收藏,
摘要: React: 1,React.render 是 React 的最基本方法,用于将模板转为 HTML 语言,并插入指定的 DOM 节点 2,React.createClass 方法就用于生成一个组件类 3,this.props 对象的属性与组件的属性一一对应 this.props.children 属 阅读全文