Skip to content

Commit

Permalink
Enhanced the TypeScript type definition for the Select component to i…
Browse files Browse the repository at this point in the history
…nclude the muiName static property
  • Loading branch information
EyaOuenniche committed Apr 2, 2024
1 parent 6b81685 commit d4da7e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/mui-material/src/Select/Select.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ export type SelectProps<Value = unknown> =
* - [Select API](https://mui.com/material-ui/api/select/)
* - inherits [OutlinedInput API](https://mui.com/material-ui/api/outlined-input/)
*/
export default function Select<Value = unknown>(
props: SelectProps<Value>,
): JSX.Element & {

declare const Select:(<Value>(props: SelectProps<Value>)=>JSX.Element) & {
muiName: string;
};

export default Select;
4 changes: 4 additions & 0 deletions packages/mui-material/src/Select/Select.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,9 @@ const AppSelect = <T extends string>(props: Props<T>) => {
</MenuItem>
))}
</Select>

);
};

//test for applying Select's static muiName property type to wrapper components
AppSelect.muiName = Select.muiName;

0 comments on commit d4da7e3

Please sign in to comment.