When trying to override the padding property in TextField input using MakeStyles, a new class is created called .makeStyles-input which is priorotized under MuiOutlinedInput-root class.
How do I inject a property into the input class (not depending on whether the OutlineInput or FilledInput component is used, and without using the important css tag)?
import { TextField } from '@mui/material';
import { makeStyles } from '@mui/styles';
const useStyles = makeStyles({
input: {
padding: 0,
},
});
function CustomTextField(props) {
const classes = useStyles();
return (
<TextField
InputProps={{
classes: {
root: classes.input,
},
}}
{...props}
/>
);
}