UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

9 lines 548 B
import { useChartContext } from "../../context/ChartProvider/index.js"; // 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 = useChartContext(); if (!context) { throw new Error('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.'); } return context.store; }