Skip to content

Commit

Permalink
[DataGrid] Remove outdated warning (@MBilalShafi) (#16370)
Browse files Browse the repository at this point in the history
Co-authored-by: Bilal Shafi <[email protected]>
  • Loading branch information
github-actions[bot] and MBilalShafi authored Jan 28, 2025
1 parent dd43aa0 commit 1f2e759
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions packages/x-data-grid/src/DataGrid/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ import { forwardRef } from '@mui/x-internals/forwardRef';
import { GridRoot } from '../components';
import { useGridAriaAttributes } from '../hooks/utils/useGridAriaAttributes';
import { useGridRowAriaAttributes } from '../hooks/features/rows/useGridRowAriaAttributes';
import { DataGridProcessedProps, DataGridProps } from '../models/props/DataGridProps';
import { DataGridProps } from '../models/props/DataGridProps';
import { GridContextProvider } from '../context/GridContextProvider';
import { useDataGridComponent } from './useDataGridComponent';
import { useDataGridProps } from './useDataGridProps';
import { GridValidRowModel } from '../models/gridRows';
import {
PropValidator,
propValidatorsDataGrid,
validateProps,
} from '../internals/utils/propValidation';
import { propValidatorsDataGrid, validateProps } from '../internals/utils/propValidation';

export type { GridSlotsComponent as GridSlots } from '../models';

Expand All @@ -24,24 +20,6 @@ const configuration = {
useGridRowAriaAttributes,
},
};
let propValidators: PropValidator<DataGridProcessedProps>[];

if (process.env.NODE_ENV !== 'production') {
propValidators = [
...propValidatorsDataGrid,
// Only validate in MIT version
(props) =>
(props.columns &&
props.columns.some((column) => column.resizable) &&
[
`MUI X: \`column.resizable = true\` is not a valid prop.`,
'Column resizing is not available in the MIT version.',
'',
'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.',
].join('\n')) ||
undefined,
];
}

const DataGridRaw = forwardRef(function DataGrid<R extends GridValidRowModel>(
inProps: DataGridProps<R>,
Expand All @@ -51,7 +29,7 @@ const DataGridRaw = forwardRef(function DataGrid<R extends GridValidRowModel>(
const privateApiRef = useDataGridComponent(props.apiRef, props);

if (process.env.NODE_ENV !== 'production') {
validateProps(props, propValidators);
validateProps(props, propValidatorsDataGrid);
}
return (
<GridContextProvider privateApiRef={privateApiRef} configuration={configuration} props={props}>
Expand Down

0 comments on commit 1f2e759

Please sign in to comment.