我正在尝试实现shouldComponentUpdate()以提高我的应用程序的性能。所以我想出了这个: //The inputs object inside the state is passed down in== nextProps.state[key].value) return false;}
它工作得很好,但我担心在shouldComponentUpdate(
官方的声明,"React.PureComponent's shouldComponentUpdate()只是肤浅地比较对象“,如果状态”很深“,则建议不要这样做。考虑到这一点,在创建React组件时,人们是否应该更喜欢React.PureComponent?问题
我猜shouldComponentUpdate() of PureComponent如果是这