Skip to content

Instantly share code, notes, and snippets.

@andormade
Created July 31, 2018 22:17
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 andormade/2ed83ed4247cd8d3d6da55bb11857825 to your computer and use it in GitHub Desktop.
Save andormade/2ed83ed4247cd8d3d6da55bb11857825 to your computer and use it in GitHub Desktop.
class Button extends React.Component {
constructor(props) {
super(props);
this.onMouseMove = this.onMouseMove.bind(this);
}
render() {
return (
<button
onMouseOver={this.onMouseOver}
onMouseDown={() => this.onMouseDown()}
onMouseUp={this.onMouseUp.bind(this)}
onMouseMove={this.onMouseMove}
onClick={this.onClick}
>Butt</button>
);
}
onMouseOver(event) { console.log(event, this); }
onMouseDown(event) { console.log(event, this); }
onMouseUp(event) { console.log(event, this); }
onMouseMove(event) { console.log(event, this); }
onClick = (event) => { console.log(event, this); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment