Created
February 10, 2017 05:04
-
-
Save selfup/4c8da13d065f8791cb6eba7f11f46dff to your computer and use it in GitHub Desktop.
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 EmailField extends Component { | |
constructor() { | |
super(); | |
this.state = { | |
email: '', | |
}; | |
} | |
handleClick = (e) => { | |
this.props.dispatch('SOMETHING', { email: e.target.innerText }): | |
this.setState({ email: '' }); | |
} | |
render() { | |
const { email } = this.state; | |
render ( | |
<div> | |
<h1>Enter your email</h1> | |
<input | |
className="email-field" | |
value={email} | |
onClick={this.handleClick} | |
/> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment