生命周期

原文链接:https://www.jianshu.com/p/4784216b8194

react的组件的一个生命周期在不同的阶段执行函数的函数有7种,它们之间有着某种联系。

  • 组件将要挂载 : componentWillMount

  • 组件挂载完成 ,包括所有的子组件: componentDidMount

  • 组件Props变化,componentWillReciveProps

  • 组件是否重新渲染(render),shouldComponentUpdata

  • 组件将要更新componentWillUpdate

  • 组件更新完成componentDidUpdate

  • 组件将要卸载componentWillUnmount

Last updated

Was this helpful?