v1.1更新说明
ckinmind opened this issue · 1 comments
ckinmind commented
- 将Footer组件独立了出来,并且修改里面的高亮的逻辑,使用Link和IndexLink来简化
- 使用PureComponent来避免写shouldComponentUpdate,减少代码量
- 更改所有的主要页面,将组件拆分成一个个文件
- 数据更新方式都通过dispatch(action), 将action分为11个action文件
- store将数据拆分为7个reducer
ckinmind commented
PureComponent之后,下面的代码就不用写了,在本应用中
shouldComponentUpdate(np, ns) {
//防止组件不必要的更新
return this.props.index !== np.index || this.state.messageCount !== ns.messageCount;
}