Commit e059c87b authored by Robert Knight's avatar Robert Knight

Test for falseyness rather than equality with null/undefined

This enables consumers to use `&&` or `||` conditionals to compute the
`icon` prop.
parent 2e9dfca2
...@@ -43,8 +43,8 @@ function MenuItem({ ...@@ -43,8 +43,8 @@ function MenuItem({
'menu-item__label--submenu': isSubmenuItem, 'menu-item__label--submenu': isSubmenuItem,
}); });
const hasLeftIcon = icon != null || isSubmenuItem; // eslint-disable-line eqeqeq const hasLeftIcon = icon || isSubmenuItem;
const hasRightIcon = icon != null && isSubmenuItem; // eslint-disable-line eqeqeq const hasRightIcon = icon && isSubmenuItem;
let renderedIcon = null; let renderedIcon = null;
if (icon !== 'blank') { if (icon !== 'blank') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment