Skip to content

Commit 30faba3

Browse files
committed
clone docs
1 parent 93e7778 commit 30faba3

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

docs/_data/nav_docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
title: Class Name Manipulation
4848
- id: test-utils
4949
title: Test Utilities
50+
- id: clone-with-props
51+
title: Cloning Components
5052
- id: examples
5153
title: Examples
5254
- title: Reference

docs/docs/09.4-test-utils.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Test Utilities
44
layout: docs
55
permalink: test-utils.html
66
prev: class-name-manipulation.html
7-
next: examples.html
7+
next: clone-with-props.html
88
---
99

1010
`React.addons.TestUtils` makes it easy to test React components in the testing framework of your choice (we use [Jasmine](http://pivotal.github.io/jasmine/) with [jsdom](https://github.com/tmpvar/jsdom)).

docs/docs/09.5-clone-with-props.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
id: clone-with-props
3+
title: Cloning Components
4+
layout: docs
5+
permalink: clone-with-props.html
6+
prev: test-utils.html
7+
next: examples.html
8+
---
9+
10+
In rare situations a component may want to change the props of a component that it doesn't own (like changing the `className` of a component passed as `this.props.children`). Other times it may want to make multiple copies of a component passed to it. `cloneWithProps()` makes this possible.
11+
12+
#### `ReactComponent React.addons.cloneWithProps(ReactComponent component, object? extraProps)`
13+
14+
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.

0 commit comments

Comments
 (0)