react生命周期详解

转自 https://www.jianshu.com/p/514fe21b9914


周期

  • 第一个是组件初始化(initialization)阶段
  • 第二个是组件的挂载(Mounting)阶段
    此阶段分为componentWillMount,render,componentDidMount三个时期。
  • 第三个是组件的更新(update)阶段
    此阶段分为componentWillReceiveProps,shouldComponentUpdate,componentWillUpdate,render,componentDidUpdate
  • 第四个是卸载阶段
    此阶段只有一个生命周期方法:componentWillUnmount
原文地址:https://www.cnblogs.com/huihuihero/p/11298944.html