Skip to main content

ThemePropsMapper

import type { ThemePropsMapper } from '@dr.pogodin/react-themes';

interface ThemePropsMapper<
ComponentProps extends ThemeableComponentProps,
> {
(
props: ThemedComponentProps<ComponentProps>,
theme: ComponentProps['theme'],
): ComponentProps;
}

ThemePropsMapper generic interface describes a function accepted by the mapThemeProps option of themed() function, and ThemedComponent.

Generic Param

  • ComponentProps extends ThemeableComponentProps — this type describes the own props of the themed component (i.e. props of the original component wrapped by themed() decorator to turn it into a themed component; and related ThemedComponentProps type describes props of that resulting themed component).

Params

Returns

  • ComponentProps — The map of properties to pass down the original component wrapped into ThemedComponent.