diff --git a/pages/api/table-pagination.md b/pages/api/table-pagination.md index 2396e2b973a551..ab9dd4000686d3 100644 --- a/pages/api/table-pagination.md +++ b/pages/api/table-pagination.md @@ -18,7 +18,7 @@ A `TableCell` based component for placing inside `TableFooter` for pagination. | labelDisplayedRows | func | ({ from, to, count }) => `${from}-${to} of ${count}` | Useful to customize the displayed rows label. | | labelRowsPerPage | node | 'Rows per page:' | Useful to customize the rows per page label. Invoked with a `{ from, to, count, page }` object. | | onChangePage * | func | | Callback fired when the page is changed.

**Signature:**
`function(event: object, page: number) => void`
*event:* The event source of the callback
*page:* The page selected | -| onChangeRowsPerPage * | func | | Callback fired when the number of rows per page is changed.

**Signature:**
`function(event: object) => void`
*event:* The event source of the callback | +| onChangeRowsPerPage | func | | Callback fired when the number of rows per page is changed.

**Signature:**
`function(event: object) => void`
*event:* The event source of the callback | | page * | number | | The zero-based index of the current page. | | rowsPerPage * | number | | The number of rows per page. | | rowsPerPageOptions | array | [5, 10, 25] | Customizes the options of the rows per page select field. If less than two options are available, no select field will be displayed. | diff --git a/src/Table/TablePagination.d.ts b/src/Table/TablePagination.d.ts index c027feeab28dac..922f25219377bb 100644 --- a/src/Table/TablePagination.d.ts +++ b/src/Table/TablePagination.d.ts @@ -18,7 +18,7 @@ export interface TablePaginationProps extends StandardProps< labelDisplayedRows?: (paginationInfo: LabelDisplayedRowsArgs) => React.ReactNode; labelRowsPerPage?: React.ReactNode; onChangePage: (event: React.MouseEvent | null, page: number) => void; - onChangeRowsPerPage: React.ChangeEventHandler; + onChangeRowsPerPage?: React.ChangeEventHandler; page: number; rowsPerPage: number; rowsPerPageOptions?: number[]; diff --git a/src/Table/TablePagination.js b/src/Table/TablePagination.js index fa8ae29a7af974..575e45c475fded 100644 --- a/src/Table/TablePagination.js +++ b/src/Table/TablePagination.js @@ -193,7 +193,7 @@ TablePagination.propTypes = { * * @param {object} event The event source of the callback */ - onChangeRowsPerPage: PropTypes.func.isRequired, + onChangeRowsPerPage: PropTypes.func, /** * The zero-based index of the current page. */