React组件生命周期-初始化阶段的函数执行顺序
2015-12-16 22:30
891 查看
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <script src="./react-0.13.2/build/react.js"></script> <script src="./react-0.13.2/build/JSXTransformer.js"></script> <script type="text/jsx"> var style = { color : "red", border: "1px #000 solid", }; var HelloWorld = React.createClass({ getDefaultProps: function(){console.log("getDefaultProps1");}, getInitialState: function(){console.log("getInitialState2");return null;}, componentWillMount:function(){console.log("componentWillMount3")}, render: function(){ console.log("render4"); return <p>初始化阶段的函数执行状态</p> }, componentDidMount:function(){console.log("componentDidMount5")} }); React.render(<div style={style}><HelloWorld></HelloWorld></div>, document.body); </script> </body> </html>
相关文章推荐
- 如何评价ionic和react native?
- React-非dom属性-key
- React 入门实例教程
- React-非dom属性-ref标签
- React-非dom属性-dangerouslySetInnerHTML标签
- React Native资料汇总
- 一看就懂的ReactJs入门教程-精华版
- ReactJS入门学习二
- Window环境下配置React Native Android环境
- react基础教程
- ReactJS入门学习一
- React Native (一) --React 入门
- React 0.14 发布,拆分为 react 和 react-dom
- React Native 中文学习网址
- asp.net mvc4 集成reactjs
- React 万能的函数表达式
- 通过表达式、函数给React组件属性赋值
- react-native源码分析系列五 绘制js组件
- React的CSS
- React Native SDK location not found