react组件的生命周期

react为每个组件ti提供了生命周期的钩子函数去响应不同的时刻-创建期存在期和销毁期。

实例化期:

当首次使用一个组

件类时候:

getDefaultProps   不是第一次调用时候,不会调用此方法

getInitialState 

componentWillMount

render

componentDidAmount

存在期:

componentWillReceiveProps

shouldComponentUpdate

render

componentDidUpdate

销毁期

componentWillUnmount

 

posted @ 2015-06-21 11:58  xiezhenzhong  阅读(228)  评论(0)    收藏  举报