Material UI Table pagination is zero-indexed, which means if I am on page 1
, it will go back to page 0
. How can I enforce to stop at page 1
?
I try passing something like this, page={pageNumber || 1}
, but it still calls onChangePage
. Even though it does not try to load Page 0
, but still its bad User Experience. You expect the previous button to be disabled in the below screenshot,
https://material-ui.com/api/table-pagination/#tablepagination-api
I don't know if I have the best solution, but I make it work, by subtracting
-1
when feeding topage={pageNumber - 1}
, and add+1
whenonChangePage = (e, pageNumber) => {..pageNumber + 1}
is called.