[material-ui] Using variant props callback errors in TypeScript #40671
Labels
bug 🐛
Something doesn't work
customization: theme
Centered around the theming features
package: material-ui
Specific to @mui/material
typescript
Related page
https://mui.com/material-ui/customization/theme-components/#creating-new-component-variants
Kind of issue
Missing information
Issue description
When customizing component variants using the createTheme approach, using a callback for variant props results in a TS error:
This seems to happen because
OverridableTypeMap
hasprops
typed to{}
andprops => ({})
does not satisfy{}
.I assume I need to do some type of module augmentation, however I am not completely sure at which level (without breaking other stuff).
Example:
EDIT: For anyone running into the same issue, ugly typecasting works (but is not a viable solution)
Context
Search keywords: customization:theme, typescript, support:question
The text was updated successfully, but these errors were encountered: