您的位置:首页 > Web前端 > React

React Native 生命周期

2016-09-21 16:38 411 查看
ReactJS :

应用由组件来组成,类似于xml ,非常清晰,每个组件维护自己的状态和UI,改变的时候自动重新渲染

全局对象: React

生命周期:

创建: getDefaultProps : 可以自定义新属性,自动和父组件的属性合并

2 实例化: getInitalstate : 处理this.state属性

3 逻辑处理: componentWillmount

4 render: 根据state渲染虚拟DOM节点并返回虚拟DOM,并将结构返回

5 componentDidMount 使用render方法返回的虚拟DOM对象,来创建真是的DOM,可以通过this.getDOMNode()获取当前组件的节点

更新:

1 componentWillReceiveProps()

2 shouldComponentUpdate()

3 componentWillUpdate()

4 componentDidUpdate()

销毁:

component W illUnmount()
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: