@mui/x-charts
Version:
The community edition of MUI X Charts components.
10 lines • 689 B
JavaScript
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
import { useChartsContext } from "../../context/ChartsProvider/index.mjs";
// This hook should be removed because user and us should not interact with the store directly, but with public/private APIs
export function useStore() {
const context = useChartsContext();
if (!context) {
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI X Charts: Could not find the Charts context. ' + 'This happens when the component is rendered outside of a ChartsContainer parent component. ' + 'Wrap your component in a ChartsContainer or ChartsDataProvider.' : _formatErrorMessage(32));
}
return context.store;
}