Skip to content

Commit

Permalink
React.Children.toArray() changes keys (#7495)
Browse files Browse the repository at this point in the history
As noted by @spicyj in #5541
(cherry picked from commit aa48c82)
  • Loading branch information
jesstelford authored and zpao committed Aug 19, 2016
1 parent 8403a28 commit 51fe7e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/docs/ref-01-top-level-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 51fe7e4

Please sign in to comment.