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
parent
commit
87ee19e698
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      components/menu/MenuItem.tsx

4
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;

Loading…
Cancel
Save