UNPKG

recharts

Version:
32 lines (29 loc) • 987 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useRechartsTheme = exports.RechartsThemeProvider = void 0; var _react = require("react"); var RechartsThemeContext = /*#__PURE__*/(0, _react.createContext)(undefined); /** * Applies the provided theme to all charts in the children tree. * * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide} * * @since 3.11 * @public */ var RechartsThemeProvider = exports.RechartsThemeProvider = RechartsThemeContext.Provider; /** * Reads the currently active theme in the children tree. * Returns the theme as-is, without modifications and without defaults. * * Can return undefined if used outside of Recharts context, or if no theme is set. * * @see {@link https://recharts.github.io/en-US/guide/theming/ Theming guide} * * @since 3.11 * @public */ var useRechartsTheme = () => (0, _react.useContext)(RechartsThemeContext); exports.useRechartsTheme = useRechartsTheme;