Skip to content

Commit

Permalink
fix: handle menu item value type (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
ychhabra-eightfold authored Apr 7, 2022
1 parent 1a33c15 commit 662caf9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/components/Menu/Menu.types.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { ButtonProps } from '../Button';
import { ListProps } from '../List';

export type MenuValue = string | number | boolean;

export interface MenuItem extends Omit<ButtonProps, 'disruptive'> {
/**
* Unique value of the menu item
*/
value: MenuValue;
}
export interface MenuItem extends Omit<ButtonProps, 'disruptive' | 'onClick'> {}

export interface MenuProps
extends Omit<ListProps<MenuItem>, 'renderItem' | 'role' | 'itemRole'> {
Expand All @@ -21,5 +14,7 @@ export interface MenuProps
* On change callback when menu item is clicked
* @param value {MenuItem}
*/
onChange?: (value: MenuValue) => void;
onChange?: (
value: string | ReadonlyArray<string> | number | undefined
) => void;
}

0 comments on commit 662caf9

Please sign in to comment.