React.cloneElement

React.cloneElement

1
2
3
4
5
ReactElement cloneElement(
  ReactElement element,
  [object props],
  [children ...]
)

Clone and return a new ReactElement 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. Unlike React.addons.cloneWithProps, key and ref from the original element will be preserved. There is no special behavior for merging any props (unlike cloneWithProps). See the v0.13 RC2 blog post for additional details.

doc_React
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.