Skip to content

Instantly share code, notes, and snippets.

@koistya
Created November 17, 2014 19:44
Show Gist options
  • Select an option

  • Save koistya/86510e383a4bcbb4c9fc to your computer and use it in GitHub Desktop.

Select an option

Save koistya/86510e383a4bcbb4c9fc to your computer and use it in GitHub Desktop.
Creating a React component
export class ComponentA {
render() {
return <form onSubmit={this.handleSubmit}>...</form>;
},
handleSubmit(e) {
// TODO: handle submit
}
}
export class ComponentB {
render() {
var handleSubmit = (e) => {
// TODO: handle submit
}
return <form onSubmit={handleSubmit}>...</form>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment