@mui/x-data-grid-premium
Version:
The Premium plan edition of the MUI X Data Grid Components.
14 lines (13 loc) • 778 B
JavaScript
'use client';
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
import * as React from 'react';
import { GridChartsIntegrationContext } from "../../components/chartsIntegration/GridChartsIntegrationContext.mjs";
export const useGridChartsIntegrationContext = (ignoreError = false) => {
const context = React.useContext(GridChartsIntegrationContext);
if (!context && !ignoreError) {
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X: Could not find the Data Grid charts integration context.
It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.
This can also happen if you are bundling multiple versions of the Data Grid.` : _formatErrorMessage(117));
}
return context;
};