Created
April 27, 2017 06:53
-
-
Save abhilashsajeev/91ebc144d97d340097c373ebb07b2e50 to your computer and use it in GitHub Desktop.
This file contains 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 Count extends React.Component { | |
constructor(){ | |
this.state = { | |
count: 0 | |
} | |
} | |
handleOnClick = ()=>{ | |
let count = this.state.count + 1; | |
this.setState({count: count}) | |
} | |
render(){ | |
return ( | |
<div> | |
<button onClick={this.handleOnclick}>Inc</butto,> | |
{{this.state.count}} | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment