From bbe55fbab98e545a275426be76212f386666230d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:38:07 +0530 Subject: [PATCH] [material-ui][Select] Fix `muiName` property TypeScript error (@EyaOuenniche) (#41786) Co-authored-by: EyaOuenniche <122678675+EyaOuenniche@users.noreply.github.com> Co-authored-by: ZeeshanTamboli --- packages/mui-material/src/Select/Select.d.ts | 15 +++++++++------ packages/mui-material/src/Select/Select.spec.tsx | 3 +++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/mui-material/src/Select/Select.d.ts b/packages/mui-material/src/Select/Select.d.ts index c39944e1e0ded8..f4984bdc71f84d 100644 --- a/packages/mui-material/src/Select/Select.d.ts +++ b/packages/mui-material/src/Select/Select.d.ts @@ -151,7 +151,8 @@ export interface BaseSelectProps variant?: SelectVariants; } -export interface FilledSelectProps extends Omit { +export interface FilledSelectProps + extends Omit { /** * The variant to use. * @default 'outlined' @@ -159,7 +160,8 @@ export interface FilledSelectProps extends Omit { +export interface StandardSelectProps + extends Omit { /** * The variant to use. * @default 'outlined' @@ -167,7 +169,8 @@ export interface StandardSelectProps extends Omit { +export interface OutlinedSelectProps + extends Omit { /** * The variant to use. * @default 'outlined' @@ -193,8 +196,8 @@ 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; diff --git a/packages/mui-material/src/Select/Select.spec.tsx b/packages/mui-material/src/Select/Select.spec.tsx index 78f69c76c606d0..0aaa8004646534 100644 --- a/packages/mui-material/src/Select/Select.spec.tsx +++ b/packages/mui-material/src/Select/Select.spec.tsx @@ -196,3 +196,6 @@ const AppSelect = (props: Props) => { ); }; + +// test for applying Select's static muiName property type to wrapper components +AppSelect.muiName = Select.muiName;