Skip to content

Instantly share code, notes, and snippets.

@ratbeard
Last active December 22, 2018 13:03
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 ratbeard/8bc9dde17f103bc113ee8a98e273336e to your computer and use it in GitHub Desktop.
Save ratbeard/8bc9dde17f103bc113ee8a98e273336e to your computer and use it in GitHub Desktop.
class BaseballCards extends Component {
render() {
return <b onClick={this.onClick}> sup</b>
}
// class-level prop, gets .bind(this) when constructing the object so `this` is always the correct object instance.
onClick = (event) => {
console.log(this, 'rules!')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment