Instantly share code, notes, and snippets.

Embed
What would you like to do?
react-testing-3.js
export class Subscription extends Component {
state = {
email: ''
};
render() {
return (
<input
id="email"
type="email"
onChange={(data) => this.onEmailChange(data.value)}
/>
<input id="submit" type="submit" onSubmit={() => this.onSubmit()}/>
)
}
onEmailChange(email) {
this.setState({email});
}
onSubmit() {
this.props.subcribe({email: this.state.email});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment