Skip to content

Commit

Permalink
[DataGridPro] Fix pagination state not updating if the data source re…
Browse files Browse the repository at this point in the history
…sponse has no rows (#15622)
  • Loading branch information
zinoroman authored Nov 28, 2024
1 parent 8725903 commit a844e60
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const useGridDataSource = (
if (cachedData !== undefined) {
const rows = cachedData.rows;
apiRef.current.setRows(rows);
if (cachedData.rowCount) {
if (cachedData.rowCount !== undefined) {
apiRef.current.setRowCount(cachedData.rowCount);
}
return;
Expand All @@ -109,7 +109,7 @@ export const useGridDataSource = (
try {
const getRowsResponse = await getRows(fetchParams);
apiRef.current.unstable_dataSource.cache.set(fetchParams, getRowsResponse);
if (getRowsResponse.rowCount) {
if (getRowsResponse.rowCount !== undefined) {
apiRef.current.setRowCount(getRowsResponse.rowCount);
}
apiRef.current.setRows(getRowsResponse.rows);
Expand Down

0 comments on commit a844e60

Please sign in to comment.