Open
Description
Steps to reproduce
Steps:
- Using Textfield with shrink to true
<TextField
slotProps={{
inputLabel: { shrink: true },
}}
/>
- Build with TypeScript (with strict)
Returns
error TS2322: Type '{ shrink: true; } | { shrink: true; } | { id?: string | undefined; role?: AriaRole | undefined; form?: string | undefined; property?: string | undefined; key?: Key | null | undefined; ... 265 more ...; shrink: true; } | ... 7 more ... | { ...; }' is not assignable to type 'SlotProps<ElementType<InputLabelProps, keyof IntrinsicElements>, {}, BaseTextFieldProps> | undefined'.
Object literal may only specify known properties, and 'shrink' does not exist in type '(Partial<Omit<DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & { ...; }> & SlotCommonProps) | ... 5 more ... | (Partial<...> & SlotCommonProps)'.'.
Current behavior
Error on build
Expected behavior
Suppose to build like
<TextField InputLabelProps={{ shrink: true }} />
Doc still suggest to use it this way even if InputLabelProps is deprecated: https://mui.com/material-ui/react-text-field/#shrink
Context
No response
Your environment
No response
Search keywords: TS2322 inputLabel slotProps Textfield