componentwillreceiveprops触发时机

父组件更新,会触发子组件的整套更新生命周期,即:componentWillReceiveProps、componentDidUpdate。
但是如果子组件内部setstate的话,只会触发子组件内部的componentDidUpdate,不会触发子组件的componentWillReceiveProps。
componentWillReceiveProps只有props改变时才会触发,内部的state变化不会触发。


版权声明:本文为sinat_38728634原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。