-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Open
Labels
docsImprovements or additions to the documentation.Improvements or additions to the documentation.support: docs-feedbackFeedback from documentation page.Feedback from documentation page.
Description
Related page
https://mui.com/material-ui/customization/palette/#typescript-2
Kind of issue
Missing information
Issue description
The "Theme augmentation" example looks complete, but it actually breaks other @mui/material/styles imports in your app if you don't include the module imports. It should include the necessary imports to avoid confusion.
People have been making this mistake: #31864
My suggestion for the theme augmentation example:
import '@mui/material/styles'; // <-- Add this line
declare module '@mui/material/styles' {
interface PaletteColor {
darker?: string;
}
interface SimplePaletteColorOptions {
darker?: string;
}
}
Context
No response
Search keywords: Theme augmentation, Typescript, theme, import
Metadata
Metadata
Assignees
Labels
docsImprovements or additions to the documentation.Improvements or additions to the documentation.support: docs-feedbackFeedback from documentation page.Feedback from documentation page.