Skip to content

Instantly share code, notes, and snippets.

@chiefGui
Created February 22, 2017 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chiefGui/4a98811cc7ff5aa69742fb9f25cd786b to your computer and use it in GitHub Desktop.
Save chiefGui/4a98811cc7ff5aa69742fb9f25cd786b to your computer and use it in GitHub Desktop.
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