mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
follow docs convention for notes
This commit is contained in:
@@ -13,8 +13,9 @@ In rare situations a component may want to change the props of a component that
|
||||
|
||||
Do a shallow copy of `component` and merge any props provided by `extraProps`. Props are merged in the same manner as [`transferPropsTo()`](/react/docs/component-api.html#transferpropsto), so props like `className` will be merged intelligently.
|
||||
|
||||
**NOTE:** `cloneWithProps` does not transfer the `key` prop to the cloned component. If you wish to preserve the key, add it to the `extraProps` object:
|
||||
|
||||
```js
|
||||
var clonedComponent = cloneWithProps(originalComponent, { key : originalComponent.props.key });
|
||||
```
|
||||
> Note:
|
||||
>
|
||||
> `cloneWithProps` does not transfer the `key` prop to the cloned component. If you wish to preserve the key, add it to the `extraProps` object:
|
||||
> ```js
|
||||
> var clonedComponent = cloneWithProps(originalComponent, { key : originalComponent.props.key });
|
||||
> ```
|
||||
|
||||
Reference in New Issue
Block a user