@@ -66,7 +66,7 @@ const TextField = React.forwardRef(function TextField(inProps, ref) {
66
66
children,
67
67
className,
68
68
component,
69
- components = { } ,
69
+ slots = { } ,
70
70
slotProps = { } ,
71
71
label,
72
72
helperText,
@@ -118,11 +118,11 @@ const TextField = React.forwardRef(function TextField(inProps, ref) {
118
118
ref,
119
119
className : clsx ( classes . root , className ) ,
120
120
elementType : TextFieldRoot ,
121
- externalForwardedProps : { ...other , component } ,
121
+ externalForwardedProps : { ...other , component, slots , slotProps } ,
122
122
ownerState,
123
123
} ) ;
124
124
125
- const Input = components . Input || JoyInput ;
125
+ const Input = slots . input || JoyInput ;
126
126
127
127
return (
128
128
< SlotRoot { ...rootProps } >
@@ -132,8 +132,8 @@ const TextField = React.forwardRef(function TextField(inProps, ref) {
132
132
id = { formLabelId }
133
133
required = { required }
134
134
{ ...slotProps . label }
135
- { ...( components . Label && {
136
- component : components . Label ,
135
+ { ...( slots . label && {
136
+ component : slots . label ,
137
137
} ) }
138
138
>
139
139
{ label }
@@ -168,8 +168,8 @@ const TextField = React.forwardRef(function TextField(inProps, ref) {
168
168
< FormHelperText
169
169
id = { helperTextId }
170
170
{ ...slotProps . helperText }
171
- { ...( components . HelperText && {
172
- component : components . HelperText ,
171
+ { ...( slots . helperText && {
172
+ component : slots . helperText ,
173
173
} ) }
174
174
>
175
175
{ helperText }
@@ -213,15 +213,6 @@ TextField.propTypes /* remove-proptypes */ = {
213
213
* Either a string to use a HTML element or a component.
214
214
*/
215
215
component : PropTypes . elementType ,
216
- /**
217
- * @ignore
218
- */
219
- components : PropTypes . shape ( {
220
- HelperText : PropTypes . elementType ,
221
- Input : PropTypes . elementType ,
222
- Label : PropTypes . elementType ,
223
- Root : PropTypes . elementType ,
224
- } ) ,
225
216
/**
226
217
* @ignore
227
218
*/
@@ -302,6 +293,15 @@ TextField.propTypes /* remove-proptypes */ = {
302
293
label : PropTypes . object ,
303
294
root : PropTypes . object ,
304
295
} ) ,
296
+ /**
297
+ * @ignore
298
+ */
299
+ slots : PropTypes . shape ( {
300
+ helperText : PropTypes . elementType ,
301
+ input : PropTypes . elementType ,
302
+ label : PropTypes . elementType ,
303
+ root : PropTypes . elementType ,
304
+ } ) ,
305
305
/**
306
306
* Leading adornment for this input.
307
307
*/
0 commit comments