1

So I wanted to add a new colour to my buttons as states in the docs here: https://v4.mui.com/customization/palette/#adding-new-colors

But it seems that is failing and throwing me this error:

Failed prop type: Invalid prop color of value tertiary supplied to ForwardRef(Button), expected one of ["default","inherit","primary","secondary"].

CodeSandbox: https://codesandbox.io/s/material-demo-forked-cxhi4?file=/demo.js

This may be a bug or bad documentation maybe?

Espi
  • 51
  • 5
  • 1
    The new color is available in the theme and you can reference the new color via theme object (e.g. in `makeStyles` or `withStyles`). But you cannot pass the newly added color in the `color` prop of the button component, as the error clearly mentioned the allowed options `expected one of ["default","inherit","primary","secondary"]`. – Junaid Faryad Sep 28 '21 at 19:19

0 Answers0