Created
May 22, 2014 17:40
-
-
Save jmorrell/0aa0ae78b82bf665476b to your computer and use it in GitHub Desktop.
React Components
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
var Component = require('component'); | |
React.renderComponent(<Component name="ben" />, document.body); |
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
var ComponentA = require('component-a'); | |
var ComponentB = require('component-b'); | |
var Component = React.createClass({ | |
render: function() { | |
return ( | |
<div className="Component"> | |
<ComponentA foo="bar"> | |
<ComponentB name={this.props.name} /> | |
</ComponentA> | |
</div> | |
); | |
} | |
}); | |
module.exports = Component; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment