首页 > 其他 > 详细

react组件的生命周期

时间:2015-06-21 13:01:52      阅读:207      评论:0      收藏:0      [点我收藏+]

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

实例化期:

当首次使用一个组

件类时候:

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

getInitialState 

componentWillMount

render

componentDidAmount

存在期:

componentWillReceiveProps

shouldComponentUpdate

render

componentDidUpdate

销毁期

componentWillUnmount

 

react组件的生命周期

原文:http://www.cnblogs.com/rubyxie/p/4591791.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!