我已经按照示例代码为 Material-UITextField
元素的下划线颜色设置样式。
http://www.material-ui.com/#/components/text-field
但是,当我尝试添加自己的样式时,React 无法识别此属性。
<TextField type="number" id="Commission" label="Commission" underlineStyle={{borderColor : orange500}} fullWidth />
我在 chrome 开发者控制台中收到以下错误消息
warning.js:33 Warning: React does not recognize the `underlineStyle` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `underlinestyle` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
in div (created by FormControl)
in FormControl (created by WithStyles(FormControl))
in WithStyles(FormControl) (created by TextField)
in TextField (created by Commissions)
in div (created by Commissions)
in div (created by Commissions)
in Commissions
in ReactPlaceholder (created by AsyncFunc)
in AsyncFunc (created by Route)
in Route (created by App)
in div (created by App)
in main (created by App)
in div (created by App)
in div (created by App)
in App (created by Connect(App))
in Connect(App) (created by Route)
in Route (created by RestrictedRoute)
in RestrictedRoute (created by App)
in div (created by App)
in IntlProvider (created by App)
in MuiThemeProvider (created by App)
in App (created by Connect(App))
in Connect(App) (created by Route)
in Route (created by MainApp)
in Switch (created by MainApp)
in Router (created by ConnectedRouter)
in ConnectedRouter (created by MainApp)
in Provider (created by MainApp)
in MainApp
npm view material-ui 版本 0.20.0
我已经确认这个属性存在于TextField
元素上。
我使用的是 Jumbo React 主题,Textfield
s 的所有下划线颜色默认为紫色。
不知道为什么我的自定义样式不会覆盖TextField
下划线颜色。