Skip to content

Commit

Permalink
make it a breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jun 18, 2021
1 parent d34dab4 commit 25f20f9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
1 change: 0 additions & 1 deletion docs/src/pages/components/data-grid/events/events.json
Expand Up @@ -162,7 +162,6 @@
"description": "Fired when the user stops resizing a column. Called with an object <code>{ field: string }</code>."
},
{ "name": "columnOrderChange", "description": "Fired when the user ends resizing a column." },
{ "name": "rowsCleared", "description": "Fired when the grid is emptied." },
{
"name": "columnsUpdated",
"description": "Fired when the columns state is changed.\nCalled with an array of strings correspoding to the field names."
Expand Down
6 changes: 0 additions & 6 deletions packages/grid/_modules_/grid/constants/eventsConstants.ts
Expand Up @@ -438,12 +438,6 @@ export const GRID_ROWS_UPDATED = 'rowsUpdated';
*/
export const GRID_ROWS_SET = 'rowsSet';

/**
* Fired when the grid is emptied.
* @event
*/
export const GRID_ROWS_CLEARED = 'rowsCleared';

/**
* Fired when the columns state is changed.
* Called with an array of strings correspoding to the field names.
Expand Down
10 changes: 1 addition & 9 deletions packages/grid/_modules_/grid/hooks/features/rows/useGridRows.ts
@@ -1,9 +1,5 @@
import * as React from 'react';
import {
GRID_ROWS_CLEARED,
GRID_ROWS_SET,
GRID_ROWS_UPDATED,
} from '../../../constants/eventsConstants';
import { GRID_ROWS_SET, GRID_ROWS_UPDATED } from '../../../constants/eventsConstants';
import { GridComponentProps } from '../../../GridComponentProps';
import { GridApiRef } from '../../../models/api/gridApiRef';
import { GridRowApi } from '../../../models/api/gridRowApi';
Expand Down Expand Up @@ -118,10 +114,6 @@ export const useGridRows = (
(allNewRows: GridRowModel[]) => {
logger.debug(`updating all rows, new length ${allNewRows.length}`);

if (internalRowsState.current.allRows.length > 0) {
apiRef.current.publishEvent(GRID_ROWS_CLEARED);
}

const allRows: GridRowId[] = [];
const idRowsLookup = allNewRows.reduce((acc, row) => {
const id = getGridRowId(row, getRowId);
Expand Down

0 comments on commit 25f20f9

Please sign in to comment.