Created
March 11, 2023 21:19
-
-
Save blvdmitry/53c699e644dd253648d04f9ec97efb31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Props<TagName extends keyof JSX.IntrinsicElements | void = void> = { | |
as?: TagName; | |
children?: React.ReactNode; | |
attributes?: Attributes<TagName>; | |
}; | |
export type Attributes<TagName = void, O = void> = Omit< | |
(TagName extends keyof JSX.IntrinsicElements | |
? JSX.IntrinsicElements[TagName] | |
: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>) & | |
DataAttributes & { style?: StyleAttribute }, | |
O extends object ? keyof O : "className" | |
>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment