@samitouri / QOS-React / commits / aa48c82b0d

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

As noted by @spicyj in #5541

Jess Telford committed Aug 16, 2016 at 16:43 UTC aa48c82b0dd088730062b2904c64f91b3220dfcf
1 file changed +4
docs/docs/ref-01-top-level-api.md
+4
@@ -132,6 +132,10 @@ array React.Children.toArray(object children)
132
133 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.
134
135 +> Note:
136 +>
137 +> `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.
138 +
139 ## ReactDOM
140
141 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.