Created
February 8, 2017 15:11
-
-
Save brandonweis/9d4e08a4aeab6140dc70576404c21dd8 to your computer and use it in GitHub Desktop.
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, { PropTypes } from 'react'; | |
const Repeater = function(props, context) { | |
const count = props.count || 1; | |
const temp = []; | |
for (let i = 0; i < count; i++) { | |
temp.push(props.children); | |
} | |
console.log(temp); | |
return ( | |
<span>{temp}</span> | |
); | |
}; | |
Repeater.propTypes = { | |
count: PropTypes.number, | |
children: PropTypes.element | |
}; | |
export default Repeater; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment