Skip to content

Instantly share code, notes, and snippets.

@nclsndr
Created March 25, 2025 11:51
Show Gist options
  • Save nclsndr/8d120674a874a0aad27cd19f30389e96 to your computer and use it in GitHub Desktop.
Save nclsndr/8d120674a874a0aad27cd19f30389e96 to your computer and use it in GitHub Desktop.
class Foo extends React.Component{
constructor( props ){
super( props );
this.handleClick = this.handleClick.bind(this);
}
handleClick(event){
// your event handling logic
}
render(){
return (
<button type="button"
onClick={this.handleClick}>
Click Me
</button>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment