Last active
March 24, 2016 06:29
-
-
Save iswanj/b8951d4212e40ccbbf28 to your computer and use it in GitHub Desktop.
Reactjs import/export component (ES6)
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'; | |
import Button from './Button'; | |
import Input from './Input'; | |
class Home extends React.Component { | |
handleClick(e) { | |
/// | |
} | |
render() { | |
return ( | |
<div> | |
<Input /> | |
<Button label="Submit" onClick={this.handleClick.bind(this)} /> | |
</div> | |
); | |
} | |
} | |
export default Home; |
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'; | |
class Input extends React.Component { | |
render() { | |
return( | |
<div> | |
<input ref="input" type="text" /> | |
</div> | |
); | |
} | |
} | |
export default Input; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment