Skip to content

Instantly share code, notes, and snippets.

@AndreiCalazans
Created February 22, 2018 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreiCalazans/be48b7e15327f6bcb0e353dfb448bc28 to your computer and use it in GitHub Desktop.
Save AndreiCalazans/be48b7e15327f6bcb0e353dfb448bc28 to your computer and use it in GitHub Desktop.
class YourCoolComponent extends Component {
state = {
counter: 0,
}
add = () => {
this.setState(prevState => ({ counter: prevState.counter + 1 }));
}
render () {
return ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment