Skip to content

Commit dd0c3d7

Browse files
committed
Check for null child before cloning menu item
1 parent c1dcbb0 commit dd0c3d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/menu/menu.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ MenuItem.propTypes = {
5858

5959

6060
const addDividerClassToFirstChild = (child, id) => (
61-
React.cloneElement(child, {
61+
child && React.cloneElement(child, {
6262
className: classNames(
6363
child.className,
6464
{[styles.menuSection]: id === 0}

0 commit comments

Comments
 (0)