Skip to content

Instantly share code, notes, and snippets.

@pixelkritzel
Created September 26, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pixelkritzel/1a9c0d0db2f2e8d76dc6 to your computer and use it in GitHub Desktop.
Save pixelkritzel/1a9c0d0db2f2e8d76dc6 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
var template = function template() { return(
<form onSubmit={ this.handleFormSubmit.bind(this) } >
<input type="text" value={ this.foo } ref="foo" />
<button type="submit">Go!</button>
</form>
)}
export class MyComponent extends Component {
constructor(props) {
super(props);
this.state = {
foo: "foo",
bar: "bar"
}
}
handleFormSubmit(event) {
event.preventDefault();
/* ... */
}
render() {
return(
return template.call(this);
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment