Files
ETB/ETB-FrontEnd/node_modules/@mui/x-charts/esm/context/ChartProvider/useChartContext.js
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

11 lines
475 B
JavaScript

'use client';
import * as React from 'react';
import { ChartContext } from "./ChartContext.js";
export const useChartContext = () => {
const context = React.useContext(ChartContext);
if (context == null) {
throw new Error(['MUI X Charts: Could not find the Chart context.', 'It looks like you rendered your component outside of a ChartDataProvider.', 'This can also happen if you are bundling multiple versions of the library.'].join('\n'));
}
return context;
};