我正在使用React Material-UI库,但不知道如何覆盖FormHelperText的样式?
const { classes } = this.props
...
<TextField
name='username'
label='Username'
error={this.state.usernameInvalid}
helperText={this.state.usernameError}
classes={{
root: classes.textField,
FormHelperText: classes.helperText // <-- how to override by right way?
}}
onChange={this.handleInputChange}
/>
...
export default withStyles(styles)(SignInPopup)
样式:
const styles = () => ({
textField: {
width: '100%'
},
helperText: {
position: 'absolute',
bottom: '-50%'
}
})
我遇到了这个错误:
Warning: Material-UI: the key `FormHelperText` provided to the classes property is not implemented in FormControl.
You can only override one of the following: root,marginNormal,marginDense,fullWidth