Skip to content

Instantly share code, notes, and snippets.

@lhahne
Last active August 29, 2015 14:23
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 lhahne/e27ad275cb0c122755c7 to your computer and use it in GitHub Desktop.
Save lhahne/e27ad275cb0c122755c7 to your computer and use it in GitHub Desktop.
declarative html generation
var HelloMessage = React.createClass({
render: function() {
var generateList = function() {
return [1, 2, 4].map(function(i) { return <li>{i}</li> });
};
return (
<div>Hello {this.props.name}
<ul>{generateList()}</ul>
</div>
);
}
});
React.render(<HelloMessage name="John" />, mountNode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment