Skip to content

Commit

Permalink
[TablePagination][material-ui] Remove type error props in SelectProp
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKristoffersson committed Sep 24, 2023
1 parent 62dfa47 commit 69b3189
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions packages/mui-material/src/TablePagination/TablePagination.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,18 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
sx?: SxProps<Theme>;
}

type SelectVariant = 'filled' | 'standard' | 'outlined';

export type SelectPropsByVariant<Variant extends SelectVariant = SelectVariant> =
Variant extends 'filled'
? TablePaginationOwnProps
: Variant extends 'standard'
? TablePaginationOwnProps
: TablePaginationOwnProps;


export interface TablePaginationTypeMap<AdditionalProps, RootComponent extends React.ElementType> {
props: AdditionalProps & TablePaginationOwnProps;
props: AdditionalProps & SelectPropsByVariant;
defaultComponent: RootComponent;
}

Expand All @@ -143,12 +153,12 @@ export interface TablePaginationTypeMap<AdditionalProps, RootComponent extends R
* - inherits [TableCell API](https://mui.com/material-ui/api/table-cell/)
*/
declare const TablePagination: OverridableComponent<
TablePaginationTypeMap<{}, React.JSXElementConstructor<TablePaginationBaseProps>>
TablePaginationTypeMap<{}, React.JSXElementConstructor<TablePaginationBaseProps>>
>;

export type TablePaginationProps<
RootComponent extends React.ElementType = React.JSXElementConstructor<TablePaginationBaseProps>,
AdditionalProps = {},
RootComponent extends React.ElementType = React.JSXElementConstructor<TablePaginationBaseProps>,
AdditionalProps = {},
> = OverrideProps<TablePaginationTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
component?: React.ElementType;
};
Expand Down

0 comments on commit 69b3189

Please sign in to comment.