Skip to content

Instantly share code, notes, and snippets.

@jmorrell
Created May 22, 2014 17:40
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 jmorrell/0aa0ae78b82bf665476b to your computer and use it in GitHub Desktop.
Save jmorrell/0aa0ae78b82bf665476b to your computer and use it in GitHub Desktop.
React Components
var Component = require('component');
React.renderComponent(<Component name="ben" />, document.body);
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