From f693517cd5a521b9a2b1f3e1a89153663c839e04 Mon Sep 17 00:00:00 2001 From: Marceli Wac Date: Sun, 4 Sep 2022 16:36:18 +0100 Subject: [PATCH 1/2] Update order of operations for pagination example Update the order of operations for pagination example so that slicing takes place after sorting. Signed-off-by: Marceli Wac --- docs/data/material/components/tables/EnhancedTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/data/material/components/tables/EnhancedTable.tsx b/docs/data/material/components/tables/EnhancedTable.tsx index 403d58b0a43b48..1bc4f92f3c68df 100644 --- a/docs/data/material/components/tables/EnhancedTable.tsx +++ b/docs/data/material/components/tables/EnhancedTable.tsx @@ -335,7 +335,7 @@ export default function EnhancedTable() { /> {/* if you don't need to support IE11, you can replace the `stableSort` call with: - rows.slice().sort(getComparator(order, orderBy)) */} + rows.sort(getComparator(order, orderBy)).slice() */} {stableSort(rows, getComparator(order, orderBy)) .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage) .map((row, index) => { From f106bedfddb3eba12ccfed747240409f23b21c0a Mon Sep 17 00:00:00 2001 From: Marceli Wac Date: Wed, 12 Oct 2022 17:17:27 +0100 Subject: [PATCH 2/2] chore(docs): Linter changes. --- docs/data/material/components/tables/EnhancedTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/data/material/components/tables/EnhancedTable.js b/docs/data/material/components/tables/EnhancedTable.js index 266325af2c1403..c89216f5fc26e8 100644 --- a/docs/data/material/components/tables/EnhancedTable.js +++ b/docs/data/material/components/tables/EnhancedTable.js @@ -304,7 +304,7 @@ export default function EnhancedTable() { /> {/* if you don't need to support IE11, you can replace the `stableSort` call with: - rows.slice().sort(getComparator(order, orderBy)) */} + rows.sort(getComparator(order, orderBy)).slice() */} {stableSort(rows, getComparator(order, orderBy)) .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage) .map((row, index) => {