Created
July 31, 2018 22:17
-
-
Save andormade/2ed83ed4247cd8d3d6da55bb11857825 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 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