ckinmind / react-cnode

👨🏻‍💻React构建的cnode社区(附详细问题说明)
https://ckinmind.github.io/react-cnode
15 stars 7 forks source link

v1.1更新说明 #1

Open ckinmind opened 7 years ago

ckinmind commented 7 years ago
ckinmind commented 7 years ago

PureComponent之后,下面的代码就不用写了,在本应用中

 shouldComponentUpdate(np, ns) {
       //防止组件不必要的更新
        return this.props.index !== np.index || this.state.messageCount !== ns.messageCount; 
    }