Skip to content

Commit 52ede8c

Browse files
authored
Only go deeper on elements that contain other elements
1 parent 9ba97ea commit 52ede8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AbstractMenu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export default class AbstractMenu extends Component {
9494
return;
9595
}
9696

97-
if ([MenuItem, this.getSubMenuType()].indexOf(child.type) < 0) {
97+
if ([MenuItem, this.getSubMenuType()].indexOf(child.type) < 0 && child.props.children instanceof Object) {
9898
// Maybe the MenuItem or SubMenu is capsuled in a wrapper div or something else
9999
React.Children.forEach(child.props.children, childCollector);
100100
} else if (!child.props.divider) {

0 commit comments

Comments
 (0)