After researching how to change the disabled TextField font color on Stack Overflow, I implemented the solution using Material-UI. However, when I tried to create a new customized TextField based on the example provided, it did not work as expected and displayed 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"
/>