Skip to content

Instantly share code, notes, and snippets.

@marcuslilja
Last active April 7, 2016 11:49
Show Gist options
  • Save marcuslilja/b1f5ad14a26876dc6f60 to your computer and use it in GitHub Desktop.
Save marcuslilja/b1f5ad14a26876dc6f60 to your computer and use it in GitHub Desktop.
Simple React Examples
import React from 'react';
class Section extends React.Component {
render () {
return (
<div className="section">
{React.Children.map(this.props.children, (child) => {
return <div className="section__main">{child}</div>;
})}
</div>
);
}
}
class Component extends React.Component {
render () {
return (
<Section>
{_.map(_.range(3), () => {
return <div className="component"></div>;
})}
</Section>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment