Created
August 20, 2018 18:09
-
-
Save pedrogk/e48525438ddf5f33299df0449877a4f0 to your computer and use it in GitHub Desktop.
Toggle normal
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 Toggle extends Component { | |
state = { | |
on: false | |
} | |
toggle = () => { | |
this.setState(() => { | |
on: !this.state.on | |
}) | |
} | |
render() { | |
return <Checkbox onClick={this.toggle} checked={this.state.on} /> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment