1、PureComponent 的使用场景PureComponent 和 Component 的区别是,PureComponent 自带 shouldComponentUpdate 生命周期函数,会对传入的props进行浅比较。PureComponent 和 immutable.js库 做结合,完美的解决react的性能问题。 2、函数式编程按需加载React.memo()包装函数。memo方法同样是自带shouldComponentUpdate 生命周期函数,会对传入的props进行浅比较。
1、PureComponent 的使用场景PureComponent 和 Component 的区别是,PureComponent 自带 shouldComponentUpdate 生命周期函数,会对传入的props进行浅比较。PureComponent 和 immutable.js库 做结合,完美的解决react的性能问题。 2、函数式编程按需加载React.memo()包装函数。memo方法同样是自带shouldComponentUpdate 生命周期函数,会对传入的props进行浅比较。
该资源仅限VIP专享下载