@@ -66,7 +66,7 @@ const TextField = React.forwardRef(function TextField(inProps, ref) {
6666 children,
6767 className,
6868 component,
69- components = { } ,
69+ slots = { } ,
7070 slotProps = { } ,
7171 label,
7272 helperText,
@@ -118,11 +118,11 @@ const TextField = React.forwardRef(function TextField(inProps, ref) {
118118 ref,
119119 className : clsx ( classes . root , className ) ,
120120 elementType : TextFieldRoot ,
121- externalForwardedProps : { ...other , component } ,
121+ externalForwardedProps : { ...other , component, slots , slotProps } ,
122122 ownerState,
123123 } ) ;
124124
125- const Input = components . Input || JoyInput ;
125+ const Input = slots . input || JoyInput ;
126126
127127 return (
128128 < SlotRoot { ...rootProps } >
@@ -132,8 +132,8 @@ const TextField = React.forwardRef(function TextField(inProps, ref) {
132132 id = { formLabelId }
133133 required = { required }
134134 { ...slotProps . label }
135- { ...( components . Label && {
136- component : components . Label ,
135+ { ...( slots . label && {
136+ component : slots . label ,
137137 } ) }
138138 >
139139 { label }
@@ -168,8 +168,8 @@ const TextField = React.forwardRef(function TextField(inProps, ref) {
168168 < FormHelperText
169169 id = { helperTextId }
170170 { ...slotProps . helperText }
171- { ...( components . HelperText && {
172- component : components . HelperText ,
171+ { ...( slots . helperText && {
172+ component : slots . helperText ,
173173 } ) }
174174 >
175175 { helperText }
@@ -213,15 +213,6 @@ TextField.propTypes /* remove-proptypes */ = {
213213 * Either a string to use a HTML element or a component.
214214 */
215215 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- } ) ,
225216 /**
226217 * @ignore
227218 */
@@ -302,6 +293,15 @@ TextField.propTypes /* remove-proptypes */ = {
302293 label : PropTypes . object ,
303294 root : PropTypes . object ,
304295 } ) ,
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+ } ) ,
305305 /**
306306 * Leading adornment for this input.
307307 */
0 commit comments