Created
February 4, 2017 19:54
-
-
Save jesse-spevack/75557faf1d9c42d607fd200e052866ea 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
```javascript | |
import {Component} from 'react' | |
class Counter extends Component { | |
state = { | |
count: 0 | |
}; | |
render() { | |
return <button onClick={this.increment.bind(this)}>{this.state.count}</button> | |
} | |
increment() { | |
this.setState({count: this.state.count + this.props.increment}); | |
} | |
} | |
export default Counter; | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment