@mui/x-data-grid-premium
Version:
The Premium plan edition of the MUI X Data Grid Components.
18 lines (17 loc) • 1 kB
JavaScript
;
'use client';
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useGridChartsIntegrationContext = void 0;
var React = _interopRequireWildcard(require("react"));
var _GridChartsIntegrationContext = require("../../components/chartsIntegration/GridChartsIntegrationContext");
const useGridChartsIntegrationContext = (ignoreError = false) => {
const context = React.useContext(_GridChartsIntegrationContext.GridChartsIntegrationContext);
if (!context && !ignoreError) {
throw new Error(['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.'].join('\n'));
}
return context;
};
exports.useGridChartsIntegrationContext = useGridChartsIntegrationContext;