[英]MUI Failed prop type: Invalid prop `color` of value `#ff9800` supplied to `ForwardRef(Link)`,
I set the color to white
and ff9800
like below.我将颜色设置为
white
和ff9800
,如下所示。
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.