I'm trying to style the helper text that comes with the TextField Component given by Material UI ( found here). I'm using FormHelperTextProps (found here). However, it seems that, for some reason, the styling I'm writing is not being applied to the component itself. I would appreciate any help I could get on this. Here is my code:
const useHelperTextStyles = makeStyles(()=> ({
root: {
"& .MuiFormHelperText-root" : { color: TextFieldColours.error["status-text"] },
// "& .MuiFormHelperText-contained"
}
})
);
const EmptyTextField = (props: CustomEmptyFieldProps) => {
const {
usernameOrPass,
} = props;
const inputLabel = "VolunteerHub " + usernameOrPass;
const errorMessage = "Please enter your VolunteerHub " + usernameOrPass;
const textFieldStyles = useTextFieldStyles(false);
const helperTextStyles = useHelperTextStyles();
return (
<div>
<TextField
className={textFieldStyles.root}
placeholder={inputLabel}
id="outlined-error-helper-text"
defaultValue=""
helperText={errorMessage}
variant="outlined"
FormHelperTextProps={{
classes={helperTextStyles.helperText,}
}}
/>
</div >
);
}