如何为helperText材质ui分配颜色以突出显示TextField中的错误

Pra*_*kar 6 css reactjs material-ui

如何为helperText 材质 UI分配颜色以突出显示 中的错误TextField。我无法helperText在材质 UI 中设置颜色。

我尝试使用MuiFormHelperText-root-406应用 CSS 但它不起作用

<Grid item xs={3}>
   <TextField
       label="EmailId" 
       name="emailId" 
       value={editItem.emailId} 
       onChange={this.editInputValue} 
       helperText={this.state.emailerror}  />      
</Grid>


.MuiFormHelperText-root-406{
   color:rgba(255,0,0,0.5);
 }
Run Code Online (Sandbox Code Playgroud)

Arp*_*tel 3

添加此代码:className={classes.textField}添加TextField

  textField: {
    marginLeft: theme.spacing(1),
    marginRight: theme.spacing(1),
    width: 200,
    '& p':{
      color:'blue',
    },
  },
Run Code Online (Sandbox Code Playgroud)
      <TextField
        id="standard-helperText"
        label="Helper text"
        defaultValue="Default Value"
        className={classes.textField}
        helperText="Some important text"
        margin="normal"
      />
Run Code Online (Sandbox Code Playgroud)