Closed
Description
React v15.5.4
Unexpected behaviour of React.Children.forEach
– silently filters functions.
Current behavior:
const element = (
<div>
{() => {}}
{() => {}}
</div>
);
console.log(React.Children.toArray(element.props.children))
// Output: []
Expected behavior:
Children.forEach should throw Invariant error then function type child is met.
or
Children.forEach shouldn't filter function type children.