Skip to content

Commit

Permalink
[TablePagination] Fix classes type (mui#15885)
Browse files Browse the repository at this point in the history
* [TablePagination] Document undesired classes behavior

* [TablePagination] Fix undesired classes behavior
  • Loading branch information
eps1lon authored May 27, 2019
1 parent 74adabe commit 20949ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export type TablePaginationClassKey =
| 'selectIcon'
| 'actions';

export type TablePaginationBaseProps = Omit<TableCellProps, 'component'>;
export type TablePaginationBaseProps = Omit<TableCellProps, 'classes' | 'component'>;

export type TablePaginationProps = SimplifiedPropsOf<typeof TablePagination>;

Expand Down
15 changes: 15 additions & 0 deletions packages/material-ui/src/TablePagination/TablePagination.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import TablePagination from '@material-ui/core/TablePagination';

function classesTest() {
const defaultProps = {
count: 1,
onChangePage: () => {},
page: 1,
rowsPerPage: 1,
};

<TablePagination classes={{ actions: 'actions' }} {...defaultProps} />;
// desired
<TablePagination classes={{ alignCenter: 'center' }} {...defaultProps} />; // $ExpectError
}

0 comments on commit 20949ec

Please sign in to comment.