Skip to content

Instantly share code, notes, and snippets.

@leopard627
Last active February 19, 2020 10:15
Show Gist options
  • Save leopard627/b8586882167a3b9124e112995b6b46f6 to your computer and use it in GitHub Desktop.
Save leopard627/b8586882167a3b9124e112995b6b46f6 to your computer and use it in GitHub Desktop.
increaseCount = () => {
const { count } = this.state;
this.setState({
count: count + 1,
});
};
increaseCount = () => {
this.setState(({ count }) => ({ count: count + 1}));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment