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

15 lines
447 B
JavaScript

'use client';
import { useChartContext } from "../context/ChartProvider/index.js";
/**
* Get the ref for the SVG element.
* @returns The SVG ref.
*/
export function useSvgRef() {
const context = useChartContext();
if (!context) {
throw new Error(['MUI X Charts: Could not find the svg ref context.', 'It looks like you rendered your component outside of a ChartContainer parent component.'].join('\n'));
}
return context.svgRef;
}