mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-24 20:53:08 +00:00
@@ -15,7 +15,9 @@ Do a shallow copy of `component` and merge any props provided by `extraProps`. T
|
||||
> Note:
|
||||
>
|
||||
> `cloneWithProps` does not transfer `key` to the cloned component. If you wish to preserve the key, add it to the `extraProps` object:
|
||||
>
|
||||
> ```js
|
||||
> var clonedComponent = cloneWithProps(originalComponent, { key : originalComponent.key });
|
||||
> ```
|
||||
>
|
||||
> `ref` is similarly not preserved.
|
||||
|
||||
Reference in New Issue
Block a user