React 经典面试题

React 经典面试题 React 17.0 为什么要废除三个生命周期。 getDerivedStateFromProps 以前我们会使用componentWillReceiveProps来做判断,如果前后props不相等,然后就setState等等。这个生命周期的出现更加简单,我们可以直接很方便的实现这中场景,getDerivedStsteFromProps方法是一个static方法,属于Rea
相关文章
相关标签/搜索