sapegin/react-group

Use React.Children.toArray instead of manual conversion

saitonakamura opened this issue · 0 comments

var children = props.children ? castArray(props.children) : [];

React has a built-in api to convert children to array even if it's a single element. It'll also do the falsy children filtering for you.

React.Children.toArray(props.children)

I've opened the PR