Material UI TextField Custom Attribute
As you can see custom props are passed to the FormControl component. What you want is probably inputProps
which is then passed down to the actual <input />
(InputComponent
is "input"
by default)
In case others didn't notice, @pier-paolo-ramon is saying to use the inputProps
prop instead of the InputProps
prop. Pay close attention to the case sensitivity.
<TextField
inputProps={{placeholder: 'Input 1', 'data-state': 'Data State 1'}}
/>