Skip to content

Instantly share code, notes, and snippets.

@eliperelman
Forked from lightsofapollo/foo.jsx
Last active March 1, 2018 23:12
Show Gist options
  • Save eliperelman/bc1b7e1d52c4982897148ccfc5cdf42a to your computer and use it in GitHub Desktop.
Save eliperelman/bc1b7e1d52c4982897148ccfc5cdf42a to your computer and use it in GitHub Desktop.
class Foo extends Component {
state = {
email: '',
password: '',
};
handleChange = e => {
this.setState({
[e.target.name]: e.target.value,
});
};
render() {
return (
<input name="email" value={this.state.email} onChange={handleChange} />
<input name="password" value={this.state.password} onChange={handleChange} />
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment