add props to jsx element

Solutions on MaxInterview for add props to jsx element by the best coders in the world

showing results for - "add props to jsx element"
Adrian
28 Jan 2016
1var clonedElementWithMoreProps = React.cloneElement(
2    this.mainContent, 
3    { anotherMessage: "nice to meet ya!" }
4);
5// now render the new cloned element? //Deep Copy
6
Hallie
02 Oct 2018
1function AddExtraProps(Component, extraProps) {
2    return <Component.type {...Component.props} {...extraProps} />;
3}
4