Skip to content

Instantly share code, notes, and snippets.

@brandonweis
Created February 8, 2017 15:11
Show Gist options
  • Save brandonweis/9d4e08a4aeab6140dc70576404c21dd8 to your computer and use it in GitHub Desktop.
Save brandonweis/9d4e08a4aeab6140dc70576404c21dd8 to your computer and use it in GitHub Desktop.
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