27

【译】React v16.4.0:你可能并不需要派生状态(Derived State)

 5 years ago
source link: https://juejin.im/post/5b3595e3f265da59a76c9ed4
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
很长一段时间,componentWillReceiveProps生命周期是在不进行额外render的前提下,响应props中的改变并更新state的唯一方式。在16.3版本中,我们介绍了一个新的替代生命周期getDerivedStateFromProps去更安

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK