Created
October 18, 2017 15:52
-
-
Save ruffle1986/f2d0850b846f48e7196a58fca9ca6d76 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
import React from 'react'; | |
class MyComponent extends React.Component { | |
handleClick() { | |
const { data } = this.state; | |
this.setState({ | |
data: data + 1 | |
}); | |
} | |
render() { | |
return ( | |
<button onClick={this.handleClick.bind(this)}> | |
Click me! | |
</button>); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment