@samitouri / QOS-React-2 / commits / 45cc5006d7

[docs] React.cloneElement

Paul O’Shannessy committed Mar 10, 2015 at 11:19 UTC 45cc5006d7346ded5f6b5ff1a06165bc270b67b4
1 file changed +13
docs/docs/ref-01-top-level-api.md
+13
@@ -36,6 +36,19 @@ Create and return a new `ReactElement` of the given type. The type argument can
36 html tag name string (eg. 'div', 'span', etc), or a `ReactClass` (created via `React.createClass`).
37
38
39 +### React.cloneElement
40 +
41 +```
42 +ReactElement cloneElement(
43 + ReactElement element,
44 + [object props],
45 + [children ...]
46 +)
47 +```
48 +
49 +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](/react/blog/2015/03/03/react-v0.13-rc2.html) for additional details.
50 +
51 +
52 ### React.createFactory
53
54 ```javascript