type Merge = Omit & P2; type PolymorphicComponent = { (props: As extends "" ? { as: keyof React.JSX.IntrinsicElements; } : As extends React.ComponentType ? Merge : As extends keyof React.JSX.IntrinsicElements ? Merge : never): React.ReactElement | null; displayName?: string; } & ((props: Merge : never, OwnProps & { as?: IntrinsicElementString; }>) => React.ReactElement | null); /** * Props type for the *implementation* of a polymorphic component — the function * body that gets cast to `PolymorphicComponent`. It's the default element's * props (so `ref`, `className`, events… are all typed) merged with the * component's own props, plus a loose `as`. Keeps each component from repeating * the `& { as?: …; className?: …; ref?: … }` annotation. */ type PolymorphicProps = Merge, OwnProps> & { as?: React.ElementType; }; export type { PolymorphicComponent, PolymorphicProps, Merge }; //# sourceMappingURL=polymorphic.d.ts.map