import * as React from 'react'; /** * A component whose root component can be controlled via a `component` prop. * * Adjusts valid props based on the type of `component`. */ export interface OverridableComponent { (props: { /** * The component used for the root node. * Either a string to use a HTML element or a component. */ component: C; } & OverrideProps & React.RefAttributes): JSX.Element; (props: DefaultComponentProps & React.RefAttributes): JSX.Element; } /** * Props of the component if `component={Component}` is used. */ export type OverrideProps = M['props'] & Omit, keyof M['props'] | 'ref'>; /** * Props if `component={Component}` is NOT used. */ export type DefaultComponentProps = M['props'] & Omit, keyof M['props'] | 'ref'>; export interface OverridableTypeMap { props: {}; defaultComponent: React.ElementType; }