-
-
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
[material-ui] Two themes customized using TypeScript theme augmentation are conflicting #40672
Comments
It doesn't look like this bug report has enough info for one of us to reproduce it. |
@ZeeshanTamboli don`t know why you need something to reproduce. This is how module augmentation works. MUI uses Typescript Declaration Merging and it works great when users merge MUI internal theme and one custom theme. But we can do it twice (or more times). The problem is that Typescript silently merges all themes in one global super theme. Which, of course, totally unwanted.
Monorepo is become more popular nowdays, so this question will appear more often I suppose. My workaround: do not use module augmentation.
|
Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information. |
@kyptov, we need reproductions because the issue might stem from another cause, and having them will help us find a solution. Are you suggesting that this is a TypeScript limitation? Unsure what actions can be taken on Material UI's side. |
Steps to reproduce
I am using mui v5 and creating a customised theme. I have two different frontend F1 and F2 and seperate theme for each frontend F1_theme and F2_theme both of them are customised using typescript via module augumentation. everything works fine if repo has one theme at a time either F1_theme or F2_theme but when repo has both theme at the time then it picks types on one theme and start validating both themes using that type.
Current behavior
No response
Expected behavior
No response
Context
No response
Your environment
npx @mui/envinfo
Search keywords: mui , mui theme , theme augmentation
The text was updated successfully, but these errors were encountered: