React.Children.toArray() changes keys (#7495)

As noted by @spicyj in #5541
(cherry picked from commit aa48c82b0d)
This commit is contained in:
Jess Telford authored and Paul O’Shannessy committed 2016-08-19 10:41:19 -07:00
1 parent 8403a28adc
commit 51fe7e466e
1 file changed
+4
+4
View File
@@ -132,6 +132,10 @@ array React.Children.toArray(object children)
Return the `children` opaque data structure as a flat array with keys assigned to each child. Useful if you want to manipulate collections of children in your render methods, especially if you want to reorder or slice `this.props.children` before passing it down.
> Note:
>
> `React.Children.toArray()` changes keys to preserve the semantics of nested arrays when flattening lists of children. That is, `toArray` prefixes each key in the returned array so that each element's key is scoped to the input array containing it.
## ReactDOM
The `react-dom` package provides DOM-specific methods that can be used at the top level of your app and as an escape hatch to get outside of the React model if you need to. Most of your components should not need to use this module.