-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AppBar][material-ui] Type error for color
property with "error", "warning" and "success" values
#39053
Comments
|
Thanks @ttlpta that is something for the meantime and better than |
@BreakBB It seems this is the official solution to add customized color to any component https://mui.com/material-ui/customization/theme-components/#creating-new-component-variants |
Well yeah for any custom colors I am totally fine with this method. But in my opinion the |
color
property with "error", "warning" and "success" values
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example: https://codesandbox.io/s/inspiring-edison-3ffqdm?file=/src/App.tsx
In the example above Typescript complains about the color attribute having a value different to:
Even though the AppBar color docs also list
| string
as possible value for thecolor
property.Current behavior 😯
The application is colored as expected, but Typescript complains about it.
Expected behavior 🤔
I expect the
color
property to fulfill the| string
type and allow at least "error", "warning" and "success" as valid values for it.Context 🔦
No response
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: