Returns the total number of components in children, equal to the number of times that a callback passed to map or forEach would be invoked.
Like React.Children.map() but does not return an array.
Invokes a function on every immediate child contained within children with this set to thisArg.
Invokes a function on every immediate child contained within children with this set to thisArg. If children is a keyed fragment or array it will be traversed: the function will never be passed the container objects. If children is null or undefined, returns null or undefined rather than an array.
Verifies that children has only one child (a React element) and returns it.
Verifies that children has only one child (a React element) and returns it. Otherwise this method throws an error.
Note: React.Children.only() does not accept the return value of React.Children.map() because it is an array rather than a React element.
Returns the children opaque data structure as a flat array with keys assigned to each child.
Returns 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.