Skip to content

Commit

Permalink
Explicitly support EUI Icons in EuiContextMenuItemIcon type definition (
Browse files Browse the repository at this point in the history
#7804)

Co-authored-by: Cee Chen <[email protected]>
  • Loading branch information
eokoneyo and cee-chen authored Jun 11, 2024
1 parent c55019e commit dacb6d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/eui/changelogs/upcoming/7804.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Updated `EuiContextMenuItemIcon`'s type definition to explicitly define support for `EuiIcon`'s `IconType`
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import {
} from '../../services';
import { validateHref } from '../../services/security/href_validator';
import { CommonProps, keysOf } from '../common';
import { EuiIcon } from '../icon';
import { EuiIcon, type IconType } from '../icon';
import { EuiToolTip, EuiToolTipProps } from '../tool_tip';

import { euiContextMenuItemStyles } from './context_menu_item.styles';

export type EuiContextMenuItemIcon = ReactElement<any> | string | HTMLElement;
export type EuiContextMenuItemIcon = IconType | ReactElement<any> | HTMLElement;

export type EuiContextMenuItemLayoutAlignment = 'center' | 'top' | 'bottom';

Expand Down Expand Up @@ -124,7 +124,7 @@ export const EuiContextMenuItem: FunctionComponent<Props> = ({
/>
) : (
// Assume it's already an instance of an icon.
cloneElementWithCss(icon as ReactElement, {
cloneElementWithCss(icon, {
css: styles.euiContextMenu__icon,
})
));
Expand Down

0 comments on commit dacb6d2

Please sign in to comment.