Skip to content

Commit

Permalink
[DataGrid] Move rowGroupingModelChange handler to respective hook (@…
Browse files Browse the repository at this point in the history
…MBilalShafi) (#15127)

Co-authored-by: Bilal Shafi <[email protected]>
  • Loading branch information
github-actions[bot] and MBilalShafi authored Oct 26, 2024
1 parent 70b178c commit fa96196
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 fa96196

Please sign in to comment.