UNPKG

beta-parity-react

Version:

Beta Parity React Components

9 lines 916 B
import React, { ElementType } from 'react'; export type PolymorphicComponentProps<C extends ElementType, Props = {}> = Props & Omit<React.ComponentPropsWithRef<C>, keyof Props> & { component?: C; }; export type PolymorphicRef<C> = C extends React.ElementType ? React.ComponentPropsWithRef<C>['ref'] : never; export declare function createPolymorphicComponent<ComponentDefaultType extends React.ElementType, Props extends {}, StaticComponents = Record<string, never>>(ui: React.ForwardRefRenderFunction<PolymorphicRef<ComponentDefaultType>, React.PropsWithoutRef<Props & { component?: ComponentDefaultType; }>>): (<C extends React.ElementType<any, keyof React.JSX.IntrinsicElements> = ComponentDefaultType>(props: PolymorphicComponentProps<C, Props>) => React.ReactElement) & Omit<React.FunctionComponent<PolymorphicComponentProps<any, Props>>, never> & StaticComponents; //# sourceMappingURL=factory.d.ts.map