Browse Source
type(menu): replace component interface with type #42907 (#42908)
Co-authored-by: Egor Miasniankin <egormyasnyankin@gmail.com>
pull/42918/head
Vetin
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
components/menu/MenuItem.tsx
|
|
@ -28,12 +28,12 @@ type GenericProps<T = unknown> = T extends infer U extends MenuItemProps |
|
|
|
: U |
|
|
|
: MenuItemProps; |
|
|
|
|
|
|
|
interface GenericComponent extends Omit<MenuItemComponent, ''> { |
|
|
|
type GenericComponent = Omit<MenuItemComponent, ''> & { |
|
|
|
<T extends MenuItemProps>( |
|
|
|
props: GenericProps<T>, |
|
|
|
...args: RestArgs<MenuItemComponent> |
|
|
|
): ReturnType<MenuItemComponent>; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const MenuItem: GenericComponent = (props) => { |
|
|
|
const { className, children, icon, title, danger } = props; |
|
|
|