16.x 之前使用componentWillReveiveProps
componentWillReceiveProps (nextProps){
if(this.props.visible !== nextProps.visible){
//props 值改变做的事
}
}
2.16.x 之后使用getDerivedStateFromProps,16.x 以后componentWillReveiveProps也未移除

16.x 之前使用componentWillReveiveProps
componentWillReceiveProps (nextProps){
if(this.props.visible !== nextProps.visible){
//props 值改变做的事
}
}
2.16.x 之后使用getDerivedStateFromProps,16.x 以后componentWillReveiveProps也未移除