Skip to content

Commit

Permalink
[marmelab#2399] chore: hardcode TablePaginationAction proptypes
Browse files Browse the repository at this point in the history
The import

```
import TablePaginationActions from '@material-ui/core/TablePaginationActions';
```

does not work anymore in material-ui’s more recent versions, as per
mui/material-ui#13524.

This commit makes transitioning from `material-ui@1.4.1` to `3.5.1` easier.
  • Loading branch information
phacks committed Nov 21, 2018
1 parent a994ab2 commit 648081f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/ra-ui-materialui/src/list/PaginationActions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { Component } from 'react';
import pure from 'recompose/pure';
import Button from '@material-ui/core/Button';
import TablePaginationActions from '@material-ui/core/TablePaginationActions';
import { withStyles } from '@material-ui/core/styles';
import ChevronLeft from '@material-ui/icons/ChevronLeft';
import ChevronRight from '@material-ui/icons/ChevronRight';
Expand Down Expand Up @@ -156,7 +155,21 @@ export class PaginationActions extends Component {
}
}

PaginationActions.propTypes = TablePaginationActions.propTypes;
/**
* PaginationActions propTypes are copied over from material-ui’s
* TablePaginationActions propTypes. See
* https://github.com/mui-org/material-ui/blob/869692ecf3812bc4577ed4dde81a9911c5949695/packages/material-ui/src/TablePaginationActions/TablePaginationActions.js#L53-L85
* for reference.
*/
PaginationActions.propTypes = {
backIconButtonProps: PropTypes.object,
count: PropTypes.number.isRequired,
nextIconButtonProps: PropTypes.object,
onChangePage: PropTypes.func.isRequired,
page: PropTypes.number.isRequired,
rowsPerPage: PropTypes.number.isRequired,
theme: PropTypes.object.isRequired,
};

const enhance = compose(
pure,
Expand Down

0 comments on commit 648081f

Please sign in to comment.