Skip to content

Instantly share code, notes, and snippets.

View dandelany's full-sized avatar
🚀
Building software for people who build spaceships

Dan Delany dandelany

🚀
Building software for people who build spaceships
View GitHub Profile
@dandelany
dandelany / gist:1ff06f4fa1f8d6f89c5e
Last active March 27, 2024 10:06
Recursively cloning React children
var RecursiveChildComponent = React.createClass({
render() {
return <div>
{this.recursiveCloneChildren(this.props.children)}
</div>
},
recursiveCloneChildren(children) {
return React.Children.map(children, child => {
if(!_.isObject(child)) return child;
var childProps = {someNew: "propToAdd"};