Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.1更新说明 #1

Open
ckinmind opened this issue Feb 11, 2017 · 1 comment
Open

v1.1更新说明 #1

ckinmind opened this issue Feb 11, 2017 · 1 comment

Comments

@ckinmind
Copy link
Owner

ckinmind commented Feb 11, 2017

  • 将Footer组件独立了出来,并且修改里面的高亮的逻辑,使用Link和IndexLink来简化
  • 使用PureComponent来避免写shouldComponentUpdate,减少代码量
  • 更改所有的主要页面,将组件拆分成一个个文件
  • 数据更新方式都通过dispatch(action), 将action分为11个action文件
  • store将数据拆分为7个reducer
@ckinmind
Copy link
Owner Author

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant