Check for null child before cloning menu item
This commit is contained in:
1 parent
c1dcbb0997
commit
dd0c3d7468
1 file changed
+1
-1
@@ -58,7 +58,7 @@ MenuItem.propTypes = {
|
||||
|
||||
|
||||
const addDividerClassToFirstChild = (child, id) => (
|
||||
React.cloneElement(child, {
|
||||
child && React.cloneElement(child, {
|
||||
className: classNames(
|
||||
child.className,
|
||||
{[styles.menuSection]: id === 0}
|
||||
|
||||
Reference in new issue
Block a user