Skip to content

Instantly share code, notes, and snippets.

@paschalidi
Created Dec 17, 2019
Embed
What would you like to do?
class SubmitButton extends React.Component {
constructor(props) {
super(props);
this.state = {
isFormSubmitted: false
};
this.handleSubmit = this.handleSubmit.bind(this);
}
handleSubmit() {
this.setState({
isFormSubmitted: true
});
}
render() {
return (
<button onClick={this.handleSubmit}>Submit</button>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment