Skip to content

Instantly share code, notes, and snippets.

@dainelmawer
Last active October 10, 2018 17:00
Show Gist options
  • Save dainelmawer/894f46d04243b9a96eb336198e77ac34 to your computer and use it in GitHub Desktop.
Save dainelmawer/894f46d04243b9a96eb336198e77ac34 to your computer and use it in GitHub Desktop.
import React, { Component ) from 'react';
class Form extends Component {
constructor() {
super();
this.handleSubmit = this.handleSubmit.bind(this);
}
handleSubmit() {
alert('Form submission');
}
render() {
return(
<form onSubmit={this.handleSubmit}>
<input type="text" placeholder="Username" />
<input type="password" placeholder="Password" />
<button type="submit">Submit</button>
</form>
);
}
}
export default Form;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment