Skip to content

Commit 69b3189

Browse files
[TablePagination][material-ui] Remove type error props in SelectProp
1 parent 62dfa47 commit 69b3189

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

packages/mui-material/src/TablePagination/TablePagination.d.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,18 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
125125
sx?: SxProps<Theme>;
126126
}
127127

128+
type SelectVariant = 'filled' | 'standard' | 'outlined';
129+
130+
export type SelectPropsByVariant<Variant extends SelectVariant = SelectVariant> =
131+
Variant extends 'filled'
132+
? TablePaginationOwnProps
133+
: Variant extends 'standard'
134+
? TablePaginationOwnProps
135+
: TablePaginationOwnProps;
136+
137+
128138
export interface TablePaginationTypeMap<AdditionalProps, RootComponent extends React.ElementType> {
129-
props: AdditionalProps & TablePaginationOwnProps;
139+
props: AdditionalProps & SelectPropsByVariant;
130140
defaultComponent: RootComponent;
131141
}
132142

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

149159
export type TablePaginationProps<
150-
RootComponent extends React.ElementType = React.JSXElementConstructor<TablePaginationBaseProps>,
151-
AdditionalProps = {},
160+
RootComponent extends React.ElementType = React.JSXElementConstructor<TablePaginationBaseProps>,
161+
AdditionalProps = {},
152162
> = OverrideProps<TablePaginationTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
153163
component?: React.ElementType;
154164
};

0 commit comments

Comments
 (0)