当组件更新时,会执行哪些生命周期?

terry React 268

如上图,过程如下:

  • shouldComponentUpdate
  • componentWillUpdate
  • render()
  • componentDidUpdate

如果是父组件的props发生改变而导致的更新,那么在shouldComponentUpdate发生之前,还会有componentWillReceiveProps方法会被执行。

  • 暂无回复内容