Skip to content

Commit bbe55fb

Browse files
github-actions[bot]EyaOuennicheZeeshanTamboli
authored
[material-ui][Select] Fix muiName property TypeScript error (@EyaOuenniche) (#41786)
Co-authored-by: EyaOuenniche <[email protected]> Co-authored-by: ZeeshanTamboli <[email protected]>
1 parent b3e95eb commit bbe55fb

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,23 +151,26 @@ export interface BaseSelectProps<Value = unknown>
151151
variant?: SelectVariants;
152152
}
153153

154-
export interface FilledSelectProps extends Omit<FilledInputProps, 'value' | 'onChange'> {
154+
export interface FilledSelectProps
155+
extends Omit<FilledInputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps'> {
155156
/**
156157
* The variant to use.
157158
* @default 'outlined'
158159
*/
159160
variant: 'filled';
160161
}
161162

162-
export interface StandardSelectProps extends Omit<InputProps, 'value' | 'onChange'> {
163+
export interface StandardSelectProps
164+
extends Omit<InputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps'> {
163165
/**
164166
* The variant to use.
165167
* @default 'outlined'
166168
*/
167169
variant: 'standard';
168170
}
169171

170-
export interface OutlinedSelectProps extends Omit<OutlinedInputProps, 'value' | 'onChange'> {
172+
export interface OutlinedSelectProps
173+
extends Omit<OutlinedInputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps'> {
171174
/**
172175
* The variant to use.
173176
* @default 'outlined'
@@ -193,8 +196,8 @@ export type SelectProps<Value = unknown> =
193196
* - [Select API](https://mui.com/material-ui/api/select/)
194197
* - inherits [OutlinedInput API](https://mui.com/material-ui/api/outlined-input/)
195198
*/
196-
export default function Select<Value = unknown>(
197-
props: SelectProps<Value>,
198-
): JSX.Element & {
199+
declare const Select: (<Value = unknown>(props: SelectProps<Value>) => JSX.Element) & {
199200
muiName: string;
200201
};
202+
203+
export default Select;

packages/mui-material/src/Select/Select.spec.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,6 @@ const AppSelect = <T extends string>(props: Props<T>) => {
196196
</Select>
197197
);
198198
};
199+
200+
// test for applying Select's static muiName property type to wrapper components
201+
AppSelect.muiName = Select.muiName;

0 commit comments

Comments
 (0)