Skip to content

Commit

Permalink
[EuiContextMenuItem] Memoize styles
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Mar 29, 2024
1 parent 537b5bc commit 5f98d22
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/context_menu/context_menu_item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import React, {
import classNames from 'classnames';

import {
useEuiTheme,
useEuiMemoizedStyles,
getSecureRelForTarget,
cloneElementWithCss,
} from '../../services';
Expand Down Expand Up @@ -104,8 +104,7 @@ export const EuiContextMenuItem: FunctionComponent<Props> = ({

const classes = classNames('euiContextMenuItem', className);

const euiTheme = useEuiTheme();
const styles = euiContextMenuItemStyles(euiTheme);
const styles = useEuiMemoizedStyles(euiContextMenuItemStyles);
const cssStyles = [
styles.euiContextMenuItem,
styles.sizes[size],
Expand Down

0 comments on commit 5f98d22

Please sign in to comment.