type(menu): replace component interface with type #42907 (#42908)

Co-authored-by: Egor Miasniankin <egormyasnyankin@gmail.com>
This commit is contained in:
Vetin 2023-06-07 20:47:36 +04:00 committed by GitHub
parent f801318868
commit 87ee19e698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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