UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

12 lines (11 loc) 790 B
'use client'; import _formatErrorMessage from "@mui/x-internals/formatErrorMessage"; import * as React from 'react'; import { ChartsLocalizationContext } from "../ChartsLocalizationProvider/ChartsLocalizationProvider.mjs"; export const useChartsLocalization = () => { const localization = React.useContext(ChartsLocalizationContext); if (localization === null) { throw new Error(process.env.NODE_ENV !== "production" ? 'MUI X Charts: Could not find the charts localization context. ' + 'This happens when the component is rendered without a ChartsLocalizationProvider. ' + 'Wrap your component in a ChartsLocalizationProvider. ' + 'This can also happen if you are bundling multiple versions of the `@mui/x-charts` package.' : _formatErrorMessage(12)); } return localization; };