Created
February 19, 2016 15:47
-
-
Save MicheleBertoli/4ef1fbe0736677a1e40d to your computer and use it in GitHub Desktop.
React Repeat
This file contains hidden or 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
| const App = React.createClass({ | |
| render() { | |
| return ( | |
| <Repeat collection={[1, 2]}> | |
| {item => <div>{item}</div>} | |
| </Repeat> | |
| ); | |
| } | |
| }); |
This file contains hidden or 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
| const Repeat = React.createClass({ | |
| render() { | |
| return <div>{this.props.collection.map(this.props.children)}</div>; | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment