14
rated 0 times
[
20]
[
6]
/ answers: 1 / hits: 82344
/ 8 Years ago, wed, april 20, 2016, 12:00:00
I'm trying to figure out how to clone an existing element with additional props.
For reference:
this.mainContent = <Hello message=Hello world! />
I attempted to do something like
React.createElement(this.mainContent, Object.assign({},
this.mainContent.props, { anotherMessage: nice to meet ya! }));
but it's not working.
How would I accomplish this?
More From » reactjs