Last active
June 12, 2018 12:12
-
-
Save Palatnyi/04e6ab08ed06b2bd020f8ac58c218825 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 Layout extends PureComponent{ | |
constructor(props) { | |
super(props) | |
this.state = { | |
showModal: false | |
} | |
} | |
toggleModal = () => this.setState({ showsModal: !this.state.showModal }) | |
render() { | |
<Fragment> | |
<Button onClick={this.toggleModal}>Toggle modal</Button> | |
//... | |
<Modal open={this.state.showModal}/> | |
//... | |
</Fragment> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment