UNPKG

reflexy

Version:

Flexbox layout react components

11 lines (10 loc) 591 B
import '@js-toolkit/utils/types'; import type React from 'react'; export type ComponentProps<C extends React.ElementType = any> = IfExtends<C, React.ElementType, OmitIndex<React.ComponentPropsWithRef<C>>, Record<never, never>>; export type GetComponentProps<C extends React.ElementType = any> = Omit<ComponentProps<C>, 'component'>; export type TweakableComponentProps<C extends React.ElementType = any> = { /** * Sets custom react component as a container. * Component must accept className and style through props. */ component?: C | undefined; } & GetComponentProps<C>;