Dropdown children now work with React.Fragment

This commit is contained in:
Gregory Schier 2019-10-30 12:30:34 -04:00
parent db9925165a
commit 61b4c6e78d

View File

@ -224,7 +224,9 @@ class Dropdown extends PureComponent {
continue;
}
if (Array.isArray(child)) {
if (child.type === React.Fragment) {
newChildren = [...newChildren, ...this._getFlattenedChildren(child.props.children)];
} else if (Array.isArray(child)) {
newChildren = [...newChildren, ...this._getFlattenedChildren(child)];
} else {
newChildren.push(child);