[docs][material-ui][Pagination] Clarify pagination page prop API#42220
[docs][material-ui][Pagination] Clarify pagination page prop API#42220ZeeshanTamboli merged 7 commits intomui:nextfrom
page prop API#42220Conversation
Signed-off-by: Mandar-Pandya <112475099+Mandar-Pandya@users.noreply.github.com>
Netlify deploy previewhttps://deploy-preview-42220--material-ui.netlify.app/ Bundle size report |
ZeeshanTamboli
left a comment
There was a problem hiding this comment.
@Mandar-Pandya Thanks for the pull request. I agree that the information should be included in the API prop description, as it feels missing. We do have a note about this in a section here:
Note that the Pagination page prop starts at 1 to match the requirement of including the value in the URL, while the TablePagination page prop starts at 0 to match the requirement of zero-based JavaScript arrays that come with rendering a lot of tabular data.
However, it would be helpful to also mention it in the API docs.
I suggest adding the following description:
The current page. The page starts at
1unlikeTablePaginationwhich starts at0.
Additionally, you'll need to update this in the usePagination type definition file here and then run the following commands:
pnpm proptypes
pnpm docs:apiThis will update the PropTypes and the docs, and fix the CI. Please refer to the Contributing guide.
page prop API
Signed-off-by: Mandar-Pandya <112475099+Mandar-Pandya@users.noreply.github.com>
Signed-off-by: Mandar-Pandya <112475099+Mandar-Pandya@users.noreply.github.com>
ZeeshanTamboli
left a comment
There was a problem hiding this comment.
@Mandar-Pandya Thanks for the improvement! I made a slight tweak to the sentence.
…42220) Signed-off-by: Mandar-Pandya <112475099+Mandar-Pandya@users.noreply.github.com> Co-authored-by: ZeeshanTamboli <zeeshan.tamboli@gmail.com>
Description
The current documentation for pagination api https://mui.com/material-ui/api/pagination/ is showing a bit of unclear description for the page attribute as it is not mentioned that is it a zero based index or not.
This is confusing because a similar api https://mui.com/material-ui/api/table-pagination/ where the same attribute is there and it is mentioned that it is a zero-based index and it might be confusing to not mentioned the same thing for pagination api i.e. it is not a zero based index.
Preview: https://deploy-preview-42220--material-ui.netlify.app/material-ui/api/pagination/#pagination-prop-page