Skip to content

Commit

Permalink
Remove the breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi committed Oct 24, 2024
1 parent 1b5bd36 commit 10747b1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/x-data-grid/src/components/cell/GridBooleanCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import { SvgIconProps } from '@mui/material/SvgIcon';
import composeClasses from '@mui/utils/composeClasses';
import { useGridSelector } from '../../hooks/utils/useGridSelector';
import { gridRowMaximumTreeDepthSelector } from '../../hooks/features/rows/gridRowsSelector';
import { getDataGridUtilityClass } from '../../constants/gridClasses';
import { GridRenderCellParams } from '../../models/params/gridCellParams';
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
import { DataGridProcessedProps } from '../../models/props/DataGridProps';
import { GridColDef } from '../../models/colDef/gridColDef';
import { isAutogeneratedRowNode } from '../../hooks/features/rows/gridRowsUtils';
import type { DataGridProcessedProps } from '../../models/props/DataGridProps';
import type { GridColDef } from '../../models/colDef/gridColDef';
import type { GridRenderCellParams } from '../../models/params/gridCellParams';

type OwnerState = { classes: DataGridProcessedProps['classes'] };

Expand Down Expand Up @@ -49,12 +51,17 @@ function GridBooleanCellRaw(props: GridBooleanCellProps) {
const ownerState = { classes: rootProps.classes };
const classes = useUtilityClasses(ownerState);

const maxDepth = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector);
const isServerSideRowGroupingRow =
// @ts-expect-error - Access tree data prop
maxDepth > 0 && rowNode.type === 'group' && rootProps.treeData === false;

const Icon = React.useMemo(
() => (value ? rootProps.slots.booleanCellTrueIcon : rootProps.slots.booleanCellFalseIcon),
[rootProps.slots.booleanCellFalseIcon, rootProps.slots.booleanCellTrueIcon, value],
);

if (value === undefined) {
if (isServerSideRowGroupingRow && value === undefined) {
return null;
}

Expand Down

0 comments on commit 10747b1

Please sign in to comment.