【React js】 笔记
2016-02-02 11:48
483 查看
一:开发工具:atom
开发工具的插件:linter,atom-jade,color-picker,javascript-snippets,linter-eslint,minimap,react
二.组件,复合组件:
三.组件通信:
http://reactjs.cn/react/tips/communicate-between-components.html
/article/2733658.html
开发工具的插件:linter,atom-jade,color-picker,javascript-snippets,linter-eslint,minimap,react
二.组件,复合组件:
var LikeButton = React.createClass({ getInitialState: function() { return {liked: false}; }, handleClick: function(event) { this.setState({liked: !this.state.liked}); }, render: function() { var text = this.state.liked ? 'click' : 'haven\'t click'; return ( <p onClick={this.handleClick}> xxx {text} xxx </p> ); } }); var ReactLocalObj = React.createClass({ render: function() { return ( <div> <div className="reactList"> <img src="/public/yade.jpg"/><br/> <img src="http://ww1.sinaimg.cn/mw600/bce7ca57gw1e4rg0coeqqj20dw099myu.jpg" width="80" height="80"/><br/> <p>杨帆</p> <p>464715077@qq.com</p> </div> </div> ); } }); //复合组件 var MySelfcontent = React.createClass({ render: function() { return ( <div> <ReactLocalObj username={this.props.username}/> <LikeButton /> <LikeButton /> </div> ); } }); class ContentPage extends Component { render() { this.context.onSetTitle(this.props.title); return ( <MySelfcontent />, ); } } export default withStyles(ContentPage, s);
三.组件通信:
http://reactjs.cn/react/tips/communicate-between-components.html
/article/2733658.html
相关文章推荐
- 解决【react-native init awesomeproject没反应】
- 【React Native开发】React Native控件之ViewPagerAndroid讲解以及美团首页顶部效果实例(17)
- react native 的js 文件从哪里获取
- react 对循环warning提示增加key的研究
- react native与现有的应用程序集成
- 搭建 React Native 开发环境
- React Native-7.React Native NavigatorIOS组件详解
- ReactNative开发中如何去掉iOS状态栏的"Loading from..."
- React 入门实例教程
- React native之IntentAndroid学习
- 【React Native开发】React Native控件之Switch开关与Picker选择器组件讲解以及使用(16)
- react native使用原生模块
- 使用react-native做一个简单的应用-04界面主框架
- 使用react-native做一个简单的应用-03欢迎界面
- React-Native 学习之 Flex布局
- React Native -ios环境搭建
- 【React Native开发】React Native控件之ToolbarAndroid工具栏控件讲解以及使用(15)
- iOS-Reactive Cocoa的常见用法
- ReactiveCocoa v2.5 源码解析 之 架构总览
- react-native:require含义