UNPKG

recharts

Version:
16 lines (15 loc) • 941 B
import { RechartsTheme } from './RechartsTheme'; /** * Backwards compatible hook for theming. * * - If the selector returns a theme slice, it is merged with `explicitProps` and acts as defaults. * - If no matching theme slice is present, the explicit props are returned without applying legacy defaults. * This allows an empty theme to leave unspecified styles unstyled while preserving user props. * * `themeSelector` selects the subset of theme which this component is interested in. * The selector is not called in case the theme is undefined. * * @deprecated this hook only exists for backwards compatibility and we will remove it in 4.x. Use {@link useRechartsTheme} instead. * @experimental */ export declare const useBackwardsCompatibleTheme: <Props extends object>(themeSelector: (theme: RechartsTheme) => Partial<Props> | undefined, explicitProps: Props, legacyDefaults: Partial<Props> | undefined) => Partial<Props>;