Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Last active September 30, 2018 04:12
Show Gist options
  • Save StevenJL/df910894e7697a22d12e7e7155328aaf to your computer and use it in GitHub Desktop.
Save StevenJL/df910894e7697a22d12e7e7155328aaf to your computer and use it in GitHub Desktop.
class ButtonComponent extends React.Component {
constructor(props) {
super(props)
this.state = {
message: 'Invoked from inside an anonymous function!',
}
}
handleClick() {
console.log(this.state.message)
}
render() {
return
< button onClick={() => this.handleClick()} />
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment