Last active
April 7, 2016 11:49
-
-
Save marcuslilja/b1f5ad14a26876dc6f60 to your computer and use it in GitHub Desktop.
Simple React Examples
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 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