/** * Extend a built-in HTMLElement's react properties (by default HTMLDivElement) */ export type ExtendProps = Props & Omit, 'as' | 'ref' | keyof Props>; export type TagNameString = keyof JSX.IntrinsicElements; export type As = React.ElementType; export type PropsOf = React.ComponentPropsWithoutRef & { as?: As; }; export type AsOrChildrenProps = { as?: undefined; children: (ref: React.Ref) => React.ReactNode; } | { /** * HTML tag name, div by default */ as: TagNameString; children?: React.ReactNode; };