Commit 7683de0 1 parent c9d87bc commit 7683de0 Copy full SHA for 7683de0
File tree 1 file changed +6
-8
lines changed
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,7 @@ export type TablePaginationProps<
24
24
AdditionalProps = { } ,
25
25
> = Omit <
26
26
MuiTablePaginationProps < RootComponent , AdditionalProps > ,
27
- | "component"
28
- | "count"
29
- | "rowsPerPage"
30
- | "onRowsPerPageChange"
31
- | "page"
32
- | "onPageChange"
33
- | "rowsPerPageOptions"
27
+ "component" | "count" | "rowsPerPage" | "page" | "rowsPerPageOptions"
34
28
> & {
35
29
children : (
36
30
data : ResultType [ "data" ] ,
@@ -60,6 +54,8 @@ const TablePagination = <
60
54
rowsPerPage : initialLimit = 50 ,
61
55
rowsPerPageOptions = [ 50 , 100 , 150 ] ,
62
56
stackProps,
57
+ onRowsPerPageChange,
58
+ onPageChange,
63
59
...tablePaginationProps
64
60
} : TablePaginationProps <
65
61
QueryArg ,
@@ -106,10 +102,12 @@ const TablePagination = <
106
102
rowsPerPage = { limit }
107
103
onRowsPerPageChange = { event => {
108
104
setPagination ( { limit : parseInt ( event . target . value ) , page : 0 } )
105
+ if ( onRowsPerPageChange ) onRowsPerPageChange ( event )
109
106
} }
110
107
page = { page }
111
- onPageChange = { ( _ , page ) => {
108
+ onPageChange = { ( event , page ) => {
112
109
setPagination ( ( { limit } ) => ( { limit, page } ) )
110
+ if ( onPageChange ) onPageChange ( event , page )
113
111
} }
114
112
// ascending order
115
113
rowsPerPageOptions = { rowsPerPageOptions . sort ( ( a , b ) => a - b ) }
You can’t perform that action at this time.
0 commit comments