xxxxxxxxxx
var clonedElementWithMoreProps = React.cloneElement(
this.mainContent,
{ anotherMessage: "nice to meet ya!" }
);
// now render the new cloned element? //Deep Copy
xxxxxxxxxx
function AddExtraProps(Component, extraProps) {
return <Component.type {Component.props} {extraProps} />;
}
xxxxxxxxxx
var clonedElementWithMoreProps = React.cloneElement(
this.mainContent,
{ anotherMessage: "nice to meet ya!" }
);
// now render the new cloned element?