简体   繁体   English

MUI 失败的道具类型:提供给 `ForwardRef(Link)` 的价值为 `#ff9800` 的无效道具`color`,

[英]MUI Failed prop type: Invalid prop `color` of value `#ff9800` supplied to `ForwardRef(Link)`,

I set the color to white and ff9800 like below.我将颜色设置为whiteff9800 ,如下所示。
And am getting this error message.并收到此错误消息。

Failed prop type: Invalid prop `color` of value `#ff9800` supplied to `ForwardRef(Link)`, expected one of ["initial","inherit","primary","secondary","textPrimary","textSecondary","error"].

How can I get rid of this?我怎样才能摆脱这个?

 <Typography variant='body2' color='white' align='center'>
    {'Copyright 🙃 '}
    <Link color='#ff9800' target='_blank' href=''></Link>
    {' '}
    {new Date().getFullYear()}
    {'.'}
 </Typography>

You can add it as inline style props: style={{ color: '#ff9800' }}您可以将其添加为内联样式道具: style={{ color: '#ff9800' }}

So your code becomes:所以你的代码变成:

 <Typography variant='body2' style={{ color: '#ff9800' }} align='center'>
    {'Copyright 🙃 '}
    <Link style={{ color: '#ff9800' }} target='_blank' href=''></Link>
    {' '}
    {new Date().getFullYear()}
    {'.'}
 </Typography>

Just apply to any one <Component/> , preferably inner component, it will work.只需适用于任何一个<Component/> ,最好是内部组件,它就会起作用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 警告:道具类型失败:提供给 `ForwardRef(Slider)` 的道具 `value` 无效 - Warning: Failed prop type: Invalid prop `value` supplied to `ForwardRef(Slider)` 失败的道具类型:提供给“ForwardRef(Grid)”的无效道具“children” - Failed prop type: Invalid prop `children` supplied to `ForwardRef(Grid)` 失败的道具类型:提供给“ForwardRef(Grid)”的无效道具“lg” - Failed prop type: Invalid prop `lg` supplied to `ForwardRef(Grid)` React Native SearchBar错误:道具类型失败:提供给`ForwardRef(TextInput)`的`array`类型的无效道具`value`,预期`string` - React Native SearchBar Error: Failed prop type: Invalid prop `value` of type `array` supplied to `ForwardRef(TextInput)`, expected `string` 道具类型失败:提供给“ForwardRef(InputBase2)”的“符号”类型的道具“类型”无效,应为“字符串” - Failed prop type: Invalid prop `type` of type `symbol` supplied to `ForwardRef(InputBase2)`, expected `string` 警告:道具类型失败:提供给“ForwardRef(Dialog)”的“function”类型的无效道具“open”,应为“boolean”。 在对话框 - Warning: Failed prop type: Invalid prop `open` of type `function` supplied to `ForwardRef(Dialog)`, expected `boolean`. at Dialog reactjs 失败的道具类型:提供给“ForwardRef(IconButton)”的“object”类型的无效道具“className”,应为“string” - reactjs Failed prop type: Invalid prop `className` of type `object` supplied to `ForwardRef(IconButton)`, expected `string` 道具类型失败:提供给“ForwardRef(TablePagination)”的“string”类型的道具“count”无效,应为“number” - Failed prop type: Invalid prop `count` of type `string` supplied to `ForwardRef(TablePagination)`, expected `number` 警告:道具类型失败:提供给“ForwardRef(FormControl)”的“string”类型的道具“error”无效,预期为“boolean” - Warning: Failed prop type: Invalid prop `error` of type `string` supplied to `ForwardRef(FormControl)`, expected `boolean` 道具类型失败:提供给“ForwardRef(DataGrid)”的“object”类型的无效道具“rows”,预期为“array” - Failed prop type: Invalid prop `rows` of type `object` supplied to `ForwardRef(DataGrid)`, expected `array`
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM