react组件的生命周期

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

实例化期:

当首次使用一个组

件类时候:

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

getInitialState 

componentWillMount

render

componentDidAmount

存在期:

componentWillReceiveProps

shouldComponentUpdate

render

componentDidUpdate

销毁期

componentWillUnmount

ruby前端观察
原文地址:https://www.cnblogs.com/rubyxie/p/4591791.html