Closed
Description
This issue was originally reported by @jimfb via facebook/react/issues/4424
Please refer to the original issue for the related discussion thread.
My understanding of the outcome is that the docs and the implementation are slightly misaligned. The docs currently say:
Returns the only child in
children
. Throws otherwise.
This is somewhat ambiguous though with regard to how it handles an array with only 1 child element. The actual implementation uses a helper method to verify that the child is an object (eg not in an array).
Let's add some clarification to the docs about exactly what this method does.