React Top-Level API: React.cloneElement()

React.cloneElement()

React.cloneElement(
  element,
  [props],
  [...children]
)

Clone and return a new React element using element as the starting point.

The resulting element will have the original element’s props with the new props merged in shallowly. New children will replace existing children. key and ref from the original element will be preserved.

React Top-Level API: React.cloneElement() — Structure map

Clickable & Draggable!

React Top-Level API: React.cloneElement() — Related pages: