Skip to content

Commit

Permalink
docs: add error for pagination with old mui version
Browse files Browse the repository at this point in the history
  • Loading branch information
Domino987 committed Oct 19, 2021
1 parent 0b3c243 commit 0617b8e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/components/MTablePagination/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ import React from 'react';
/* eslint-enable no-unused-vars */

function MTablePagination(props) {
if (process.env.NODE_ENV === 'development' && !props.onPageChange) {
console.error(
'The prop `onPageChange` in pagination is undefined and paging does not work. ' +
'This is most likely caused by an old material-ui version <= 4.11.X.' +
'To fix this, install either material-ui >=4.12 or downgrade material-table-core to <=3.0.15.'
);
}
const handleFirstPageButtonClick = (event) => {
props.onPageChange(event, 0);
};
Expand Down

0 comments on commit 0617b8e

Please sign in to comment.