Fix TypeScript Error for ButtonProps (#8101)

This commit is contained in:
Sachin Chaurasiya 2022-10-12 12:59:36 +05:30 committed by GitHub
parent 7aaaddf7cc
commit ceb6e5b72d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,9 +13,8 @@
import React, { ReactNode } from 'react';
export interface Props {
export interface CommonProps {
block?: boolean;
children?: ReactNode;
className?: string;
disabled?: boolean;
size?: 'large' | 'regular' | 'small' | 'x-small' | 'custom';
@ -24,7 +23,7 @@ export interface Props {
}
export interface ButtonAsButtonProps
extends Props,
extends CommonProps,
React.ButtonHTMLAttributes<HTMLButtonElement> {
/**
* The element that should be rendered as a button
@ -37,13 +36,13 @@ export interface ButtonAsButtonProps
}
export interface ButtonAsAnchorProps
extends Props,
extends CommonProps,
React.AnchorHTMLAttributes<HTMLAnchorElement> {
tag?: 'a';
}
export interface ButtonAsOtherProps
extends Props,
extends CommonProps,
React.AnchorHTMLAttributes<HTMLAnchorElement> {
tag?: string;
}