ThemedComponentProps
import type { ThemedComponentProps } from '@dr.pogodin/react-themes';
type ThemedComponentProps<
ComponentProps extends ThemeableComponentProps,
> = Omit<ComponentProps, 'theme'> & {
children?: ReactNode;
composeAdhocTheme?: COMPOSE;
composeContextTheme?: COMPOSE;
mapThemeProps?: ThemePropsMapper<ComponentProps>;
ref?: RefObject<unknown>;
theme?: ComponentProps['theme'];
themePriority?: PRIORITY;
};
The ThemedComponentProps generic type describes props accepted by a themed component (i.e. by the component created by wrapping the original themable component with themed() function).
Generic Parameter
ComponentPropsextends ThemeableComponentProps — Props accepted by the original component, wrapped by themed() function.
Fields
- It includes all original
ComponentProps, which are passed to the wrapped original component.
Optional
-
children— ReactNode — All themed components accept children, which are passed to the wrapped original component. -
composeAdhocTheme— COMPOSE — Composition mode for ad hoc theme, for this component instance (overrides default option set via themed()). -
composeContextTheme— COMPOSE — Composition mode for context theme, for this component instance (overrides default option set via themed()). -
mapThemeProps— ThemePropsMapper<ComponentProps> — Allows to customise props passed down to the wrapped component, for this component instance, overriding the default mapper funtion set via themed() options (seemapThemePropsoption of ThemedOptions). -
ref— RefObject<unknown> — All themed components accept references, which are passed down to the original wrapped component. -
theme— ComponentProps['theme'] — Ad hoc theme for the component instance. Whilethemeis obligatory prop for the original component (see ThemeableComponentProps), it becomes optional for themed component (if not provided, the wrapped component still gets theme composed by the library from default and context themes). -
themePriority— PRIORITY — Theme priority mode for the component instance (overrides default option set via themed()).