Created
March 25, 2025 11:51
-
-
Save nclsndr/8d120674a874a0aad27cd19f30389e96 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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