react 生命周期

  • props 变化时候 需要更新,用 static getDerivedStateFromProps
static getDerivedStateFromProps(props, state)  {
}
原文地址:https://www.cnblogs.com/Running00/p/12067247.html