diff --git a/src/components/context_menu/context_menu_item.js b/src/components/context_menu/context_menu_item.js
index 142b4b5e42f2..2e230d37b536 100644
--- a/src/components/context_menu/context_menu_item.js
+++ b/src/components/context_menu/context_menu_item.js
@@ -98,6 +98,16 @@ export class EuiContextMenuItem extends Component {
'euiContextMenuItem-isDisabled': disabled,
});
+ const buttonInner = (
+
+ {iconInstance}
+
+ {children}
+
+ {arrow}
+
+ );
+
let button;
// elements don't respect the `disabled` attribute. So if we're disabled, we'll just pretend
// this is a button and piggyback off its disabled styles.
@@ -113,13 +123,7 @@ export class EuiContextMenuItem extends Component {
ref={buttonRef}
{...rest}
>
-
- {iconInstance}
-
- {children}
-
- {arrow}
-
+ {buttonInner}
);
} else {
@@ -131,13 +135,7 @@ export class EuiContextMenuItem extends Component {
ref={buttonRef}
{...rest}
>
-
- {iconInstance}
-
- {children}
-
- {arrow}
-
+ {buttonInner}
);
}