如何解决警告值"继承"提供给"ForwardRef(TextField)"的无效道具"颜色",预期为 [ "primary" , "secondary" ] 之一



我收到此警告

警告:失败的道具类型:为ForwardRef(TextField)提供的值为inherit的道具color无效,应为["primary"、"secondary"]之一

我尝试将颜色从inherit更改为primary而且我也变了从"@material-ui/core/styles/MuiThemeProvider"导入MuiThemyProvider从"@material-ui/core/styles"导入{ThemeProvider as MuiThemeProvider}仍然错误保持相同

为了使dependencyY文件对我有效,我从更改了package.json

"依赖项":{"@材料ui/core":"^4.6.1","@材料ui/icons":"^4.5.1",}

至"依赖项":{"@材料ui/core":"~4.4.1","@材质ui/icons":"^4.5.1",}现在运行良好

这似乎是由最近对Material ui模块的更新引起的问题。这对我很有效https://github.com/mbrn/material-table/issues/1293#issuecomment-558972419

最新更新