Closed
Description
I created a new color palette I want to use on a Button as in accordance to the documentation:
const theme = createTheme({
palette: {
customRed: {
main: "#ff1100",
light: "#f75348",
dark: "#ba1f14",
contrastText: "#FFF",
},
}
})
Then extended TypeScript declarations:
declare module "@mui/material/styles" {
interface Palette {
customRed: Palette["primary"];
}
interface PaletteOptions {
customRed?: PaletteOptions["primary"];
}
But then I get a TS error when using the new color palette on a Button (Type "customRed" is not assignable to type):
ButtonIt should work and it used to work for me in the past, but now it doesn't. Any ideas on how to expand my color palette for buttons?
Search keywords: