Skip to content

Commit

Permalink
[data grid] Remove dead code in internal GridPreferencesPanel (#13934)
Browse files Browse the repository at this point in the history
Co-authored-by: Rom Grk <romgrk.cc@gmail.com>
  • Loading branch information
k-rajat19 and romgrk authored Jul 23, 2024
1 parent 88b9a96 commit 6d18f15
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';

export const GridPreferencesPanel = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(function GridPreferencesPanel(props, ref) {
export function GridPreferencesPanel() {
const apiRef = useGridApiContext();
const columns = useGridSelector(apiRef, gridColumnDefinitionsSelector);
const rootProps = useGridRootProps();
Expand All @@ -23,16 +20,14 @@ export const GridPreferencesPanel = React.forwardRef<

return (
<rootProps.slots.panel
ref={ref}
as={rootProps.slots.basePopper}
open={columns.length > 0 && preferencePanelState.open}
id={preferencePanelState.panelId}
aria-labelledby={preferencePanelState.labelId}
{...rootProps.slotProps?.panel}
{...props}
{...rootProps.slotProps?.basePopper}
>
{panelContent}
</rootProps.slots.panel>
);
});
}

0 comments on commit 6d18f15

Please sign in to comment.