Incorrent props type for GridPagination
Duplicates
- [X] I have searched the existing issues
Latest version
- [X] I have tested the latest version
Current behavior 😯
Wrong definition for GridPagination props, see https://github.com/mui/mui-x/blob/d94c20e7471ca9b3bb4e889cd2e907868b942434/packages/grid/x-data-grid/src/components/GridPagination.tsx#L27-L29
now it's React.HTMLAttributes<HTMLDivElement>, wrong generic type for forwardRef
Expected behavior 🤔
it should be subtype of props type of TablePagination
Steps to reproduce 🕹
not needed
Context 🔦
No response
Your environment 🌎
not needed
Order ID 💳 (optional)
No response
Hey @scott-avery
Indeed, it should use TablePaginationProps instead:
- React.HTMLAttributes<HTMLDivElement>
+ Partial<TablePaginationProps>
Are you using GridPagination directly for some kind of customization?
Can you share more details about your use case?
@cherniavskii yes, I have to wrap the GridPagination to add a page select, allowing user to go to specific page quickly. Currently that function is not available in official library.
@scott-avery Thanks for the details!
By the way, there's a demo using Material UI Pagination component instead of default TablePagination: https://mui.com/x/react-data-grid/components/#pagination
Maybe you'll find it useful as well