I'm trying to change disabled TextField font color and I followed related questions about it in stackoverflow but when I create a new TextField like below it does not work and shows nothing.
import {withStyles} from '@material-ui/core/styles';
import TextField from "@material-ui/core/TextField";
const myTextField = withStyles({
root: {
"& .MuiInputBase-root.Mui-disabled": {
color: "rgba(0, 0, 0,0.0)"
}
}
})(TextField);
<myTextField
value={user != null ? user.nam : null}
disabled={true}
variant="outlined"
margin="normal"
fullWidth
id="nam"
autoFocus
label="nam"
/>
<TextField
value={user != null ? user.famil : null}
disabled={true}
variant="outlined"
margin="normal"
fullWidth
id="famil"
autoFocus
label="famil"
/>
It shows the TextField "famil" but doesn't show myTextField "nam"