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

Refactoring React code of Theme #539

Open
sonufrienko opened this issue Aug 8, 2018 · 0 comments
Open

Refactoring React code of Theme #539

sonufrienko opened this issue Aug 8, 2018 · 0 comments
Assignees
Milestone

Comments

@sonufrienko
Copy link
Collaborator

We can improve speed of rendering.

Todo:

  1. replace index to *.id where we can
  2. remove computing from render() method
  3. use PureComponent where we can
  4. replace
onClick={() => {...}} 

with

onClick(this.handleClick)
  1. Use setState callback. Replace
this.setState({ total: this.state.total + 1 });

with

this.setState((prevState) => ({ total: prevState.total + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant