خرید بک لینک

Vote count: 1

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?

asked 5 mins ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 2 ارديبهشت 1395 ساعت: 0:12

صفحه بندی