Created
February 22, 2017 12:08
-
-
Save chiefGui/4a98811cc7ff5aa69742fb9f25cd786b 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
import React, {Component} from 'react' | |
import Modal from '../components/Modal' | |
class Home extends Component { | |
state = {isContactModalOpen: false} | |
render () { | |
const {isContactModalOpen} = this.state | |
return ( | |
<div> | |
<Modal isOpen={isContactModalOpen} /> | |
<h1>Hello world!</h1> | |
<hr /> | |
<p>What a beautiful day to learn about React's state—don't you think?</p> | |
<hr /> | |
<button onClick={this.setState({isContactModalOpen: true})}>Get in touch</button> | |
</div> | |
) | |
} | |
} | |
export default Modal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment