MCPcopy
hub / github.com/facebook/react / toArray

Function toArray

packages/react/src/ReactChildren.js:428–430  ·  view source on GitHub ↗

* Flatten a children object (typically specified as `props.children`) and * return an array with appropriately re-keyed children. * * See https://reactjs.org/docs/react-api.html#reactchildrentoarray

(children: ?ReactNodeList)

Source from the content-addressed store, hash-verified

426 * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
427 */
428function toArray(children: ?ReactNodeList): Array<React$Node> {
429 return mapChildren(children, child => child) || [];
430}
431
432/**
433 * Returns the first child in a collection of children and verifies that there

Callers

nothing calls this directly

Calls 1

mapChildrenFunction · 0.85

Tested by

no test coverage detected