Closed
Description
My component can have multiple children components. They can be of different types: Strings, JSX Components and functions.
<ChildrenCounter>
First
{() => <div>Second</div>}
</ChildrenCounter>
I wanted to render them using React.children.map helper function that unwraps the children opaque data structure. The problem is that children defined as functions seem to be ignored by React.children.map, React.children.count and other helper functions. See the example:
https://jsfiddle.net/bpdsraah/2/
I can access them and render directly from props.children wrapper but it is not a convenient way as one can never know for sure what type it will be.