Instantly share code, notes, and snippets.

Embed
What would you like to do?
react-testing-4.js
export class Subscription extends Component {
state = {
email: ''
};
render() {
return (
...
<MarketingContent logo={logo}/>
<EmailInput onChange={(email) => this.onEmailChange(email)}/>
<SubmitButton 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