ThemedOptions
import type { ThemedOptions } from '@dr.pogodin/react-themes`;
type ThemedOptions<
ComponentProps extends ThemeableComponentProps,
> = {
composeAdhocTheme?: COMPOSE;
composeContextTheme?: COMPOSE;
mapThemeProps?: ThemePropsMapper<ComponentProps>;
themePriority?: PRIORITY;
// These options are not intended for TypeScript use case, they are assumed
// to be fixed at the values below; but their custom values are still supported
// in plain JavaScript.
adhocTag?: 'ad.hoc';
contextTag?: 'context';
};
The ThemedOptions type specifies options accepted by themed() function.
-
.composeAdhocTheme— COMPOSE — Composition type for ad hoc theme, which is merged into the result of composition of lower priority themes. Must be one of COMPOSE values. DefaultsCOMPOSE.DEEP. -
.composeContextTheme— COMPOSE — Composition type for context theme into default theme (or vice verca, if opted bythemePriorityoverride). Must be one of COMPOSE values. DefaultsCOMPOSE.DEEP. -
.mapThemeProps— ThemePropsMapper — By default, a themed component created by themed() does not pass into the original base component any props introduced by this library. A function provided by this option will get the composed theme and all properties, and the result from this function call will be passed as props down the base component. -
.themePriority— PRIORITY — Theme priorities. Must be one of PRIORITY values. DefaultsPRIORITY.ADHOC_CONTEXT_DEFAULT.
The following two options, inherited from the original JavaScript implementation, still work, but they do not fit well with TypeScript restrictions, thus, at least for now, we assume they are always set to their default values.
.adhocTag— string — Overrides "ad.hoc" theme key. Defaults"ad.hoc"..contextTag— string — Overrides context theme key. Defaults"context".