From eb40a6e63dd42fb28fed0fdb0acb65001582e6b4 Mon Sep 17 00:00:00 2001 From: Mandar-Pandya <112475099+Mandar-Pandya@users.noreply.github.com> Date: Thu, 16 May 2024 19:42:45 +0530 Subject: [PATCH] [docs][material-ui][Pagination] Clarify pagination `page` prop API (#42220) Signed-off-by: Mandar-Pandya <112475099+Mandar-Pandya@users.noreply.github.com> Co-authored-by: ZeeshanTamboli --- docs/translations/api-docs/pagination/pagination.json | 4 +++- packages/mui-material/src/Pagination/Pagination.js | 2 +- packages/mui-material/src/usePagination/usePagination.d.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/translations/api-docs/pagination/pagination.json b/docs/translations/api-docs/pagination/pagination.json index 1cac07aefe0446..be7d0c034f0cf1 100644 --- a/docs/translations/api-docs/pagination/pagination.json +++ b/docs/translations/api-docs/pagination/pagination.json @@ -28,7 +28,9 @@ "page": "The page selected." } }, - "page": { "description": "The current page." }, + "page": { + "description": "The current page. Unlike TablePagination, which starts numbering from 0, this pagination starts from 1." + }, "renderItem": { "description": "Render the item.", "typeDescriptions": { "params": "The props to spread on a PaginationItem." } diff --git a/packages/mui-material/src/Pagination/Pagination.js b/packages/mui-material/src/Pagination/Pagination.js index 659f4588fd1989..00365121ccf1e5 100644 --- a/packages/mui-material/src/Pagination/Pagination.js +++ b/packages/mui-material/src/Pagination/Pagination.js @@ -198,7 +198,7 @@ Pagination.propTypes /* remove-proptypes */ = { */ onChange: PropTypes.func, /** - * The current page. + * The current page. Unlike `TablePagination`, which starts numbering from `0`, this pagination starts from `1`. */ page: integerPropType, /** diff --git a/packages/mui-material/src/usePagination/usePagination.d.ts b/packages/mui-material/src/usePagination/usePagination.d.ts index 3b8de8f2759b9e..3332320107eb58 100644 --- a/packages/mui-material/src/usePagination/usePagination.d.ts +++ b/packages/mui-material/src/usePagination/usePagination.d.ts @@ -43,7 +43,7 @@ export interface UsePaginationProps { */ onChange?: (event: React.ChangeEvent, page: number) => void; /** - * The current page. + * The current page. Unlike `TablePagination`, which starts numbering from `0`, this pagination starts from `1`. */ page?: number; /**