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

Viewed 1433

I set the color to white and ff9800 like below.
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>
1 Answers

You can add it as inline style props: 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.

Related