Material ui Can';t使用材质ui中的类替代样式
我花了很长时间试图了解如何更改样式以一次性使用Material ui Can';t使用材质ui中的类替代样式,material-ui,Material Ui,我花了很长时间试图了解如何更改样式以一次性使用TextField 这些文件对我来说真的毫无意义 <FormControl> <InputLabel htmlFor="mobile-number-input" > Mobile Number </InputLabel> <Input value={this.state.mobileNumber} onChange={this.onMobileNumberCha
TextField
这些文件对我来说真的毫无意义
<FormControl>
<InputLabel
htmlFor="mobile-number-input"
>
Mobile Number
</InputLabel>
<Input
value={this.state.mobileNumber}
onChange={this.onMobileNumberChange}
fullWidth
classes={{
inkbar: {
'&:after': {
backgroundColor: 'white',
}
}
}}
id="mobile-number-input"
/>
</FormControl><br />
您需要使用另一个类的名称(而不是JSS对象)覆盖
inkbar
一种方法是在组件外部声明JSS对象,并使用with style
高阶组件为组件提供一个类
道具,该道具将JSS中定义的类名映射到它们的实际名称:
从“材质ui/样式”导入{with样式};
常量样式={
inkbarOverride:{
“&:在”之后:{
背景颜色:“白色”,
}
}
};
常量测试=({classes})=>
手机号码
导出默认样式(样式)(测试);
有关更多信息,请参阅
Warning: Material-UI: the key `inkbar` provided to the classes property is not valid for Input.
You need to provide a non empty string instead of: [object Object].