Skip to content

Instantly share code, notes, and snippets.

@skiabox
Last active September 23, 2020 14:10
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 skiabox/6d776ac0c1394a051ebb0f79cb3dcb24 to your computer and use it in GitHub Desktop.
Save skiabox/6d776ac0c1394a051ebb0f79cb3dcb24 to your computer and use it in GitHub Desktop.
handleClick = () => {
this.setState((prevState, prevProps) => {
return {meaningOfLife: prevState.meaningOfLife + 1},
() => console.log(this.state.meaningOfLife)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment