react的生命周期主要分为:初始化,更新,卸载
react之生命周期
初始化: componentDidMount是指组件被插入到DOM中时,触发
更新:componentDidUpdate是指传入新的props,或者调用setState()或者调用forceUpdate()时触发,componentDidUpdate(currentProps, currentState)接收两个两个参数.
currentProps:当前的props
currentState:当前的state

相关文章:

  • 2021-10-15
  • 2021-04-17
  • 2021-06-08
猜你喜欢
  • 2021-10-17
  • 2021-06-24
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案