Created
September 26, 2015 14:00
-
-
Save pixelkritzel/a79dc3dad1382ab0ee50 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import template from './MyComponentsTemplate'; | |
export class MyComponent extends Component { | |
/* skipping all this */ | |
render() { | |
retun template.call(this) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
export class MyComponent extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
foo: "foo", | |
bar: "bar" | |
} | |
} | |
handleFormSubmit(event) { | |
event.preventDefault(); | |
/* ... */ | |
} | |
render() { | |
return( | |
<form onSubmit={ this.handleFormSubmit.bind(this) } > | |
<input type="text" value={ this.foo } ref="foo" /> | |
<button type="submit">Go!</button> | |
</form> | |
) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
var template = function(){return( | |
<form onSubmit={ this.handleFormSubmit.bind(this) } > | |
<input type="text" value={ this.foo } ref="foo" /> | |
<button type="submit">Go!</button> | |
</form> | |
)} | |
export default template; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment