Skip to content

Commit

Permalink
[DataGrid] Move rowGroupingModelChange handler to respective hook (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi authored and web-flow committed Oct 25, 2024
1 parent 70b178c commit 4cfc711
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ export const useGridRowGrouping = (
useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);
useGridApiEventHandler(apiRef, 'columnsChange', checkGroupingColumnsModelDiff);
useGridApiEventHandler(apiRef, 'rowGroupingModelChange', checkGroupingColumnsModelDiff);
useGridApiEventHandler(apiRef, 'rowGroupingModelChange', () =>
apiRef.current.unstable_dataSource.fetchRows(),
);

/*
* EFFECTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ export const useGridDataSource = (
'paginationModelChange',
runIfServerMode(props.paginationMode, fetchRows),
);
// @ts-ignore - Event is not defined in the Pro API
useGridApiEventHandler(apiRef, 'rowGroupingModelChange', () => fetchRows());

const isFirstRender = React.useRef(true);
React.useEffect(() => {
Expand Down

0 comments on commit 4cfc711

Please sign in to comment.