From d4da7e32eb0163a6583aa16f954a03211542a6b1 Mon Sep 17 00:00:00 2001 From: EyaOuenniche Date: Tue, 2 Apr 2024 10:08:43 +0100 Subject: [PATCH] Enhanced the TypeScript type definition for the Select component to include the muiName static property --- packages/mui-material/src/Select/Select.d.ts | 7 ++++--- packages/mui-material/src/Select/Select.spec.tsx | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/mui-material/src/Select/Select.d.ts b/packages/mui-material/src/Select/Select.d.ts index c39944e1e0ded8..25afcedee9ceb9 100644 --- a/packages/mui-material/src/Select/Select.d.ts +++ b/packages/mui-material/src/Select/Select.d.ts @@ -193,8 +193,9 @@ export type SelectProps = * - [Select API](https://mui.com/material-ui/api/select/) * - inherits [OutlinedInput API](https://mui.com/material-ui/api/outlined-input/) */ -export default function Select( - props: SelectProps, -): JSX.Element & { + +declare const Select:((props: SelectProps)=>JSX.Element) & { muiName: string; }; + +export default Select; \ No newline at end of file diff --git a/packages/mui-material/src/Select/Select.spec.tsx b/packages/mui-material/src/Select/Select.spec.tsx index 78f69c76c606d0..f651c3a2b92ae5 100644 --- a/packages/mui-material/src/Select/Select.spec.tsx +++ b/packages/mui-material/src/Select/Select.spec.tsx @@ -194,5 +194,9 @@ const AppSelect = (props: Props) => { ))} + ); }; + +//test for applying Select's static muiName property type to wrapper components +AppSelect.muiName = Select.muiName;