|
|
@@ -59,15 +59,15 @@ interface LinkButtonAnchorProps extends Pick<React.HTMLProps<LinkButtonDerivedEl |
|
|
|
component: typeof LinkButtonDerivedElementComponent; |
|
|
|
} |
|
|
|
|
|
|
|
interface LinkButtonComponentType { |
|
|
|
(props: { href?: string }): React.ReactNode; |
|
|
|
export interface LinkButtonComponentType { |
|
|
|
(props: { href: string }): React.ReactNode; |
|
|
|
} |
|
|
|
|
|
|
|
interface LinkButtonFCProps< |
|
|
|
C extends LinkButtonComponentType = LinkButtonComponentType |
|
|
|
> { |
|
|
|
component: C; |
|
|
|
href: C extends (props: { href?: infer Href }) => React.ReactNode ? Href : never; |
|
|
|
href: C extends (props: { href: infer Href }) => React.ReactNode ? Href : never; |
|
|
|
} |
|
|
|
|
|
|
|
type LinkButtonAllProps< |
|
|
@@ -262,19 +262,3 @@ LinkButton.defaultProps = { |
|
|
|
// eslint-disable-next-line react/default-props-match-prop-types |
|
|
|
href: undefined, |
|
|
|
}; |
|
|
|
|
|
|
|
// extend the component type here for defining new props |
|
|
|
// interface LinkButtonComponentType { |
|
|
|
// (props: { href?: number }): React.ReactNode; |
|
|
|
// } |
|
|
|
|
|
|
|
// const CustomLink = (props: { href?: string | number }) => { |
|
|
|
// return null; |
|
|
|
// }; |
|
|
|
// |
|
|
|
// const a = ( |
|
|
|
// <LinkButton |
|
|
|
// component="a" |
|
|
|
// href="string" |
|
|
|
// /> |
|
|
|
// ); |