I can put some effort in making an environment, but I hope the comment above is enough using code inspection to suffice for "steps to reproduce". Requested by @siriwatknp, suggested fix included in the PR comment above.
Current behavior
Themes with a undefined/null value will crash
Expected behavior
While not happy path, Switch should tolerate themes with a value that is undefined/null.
Context
Our application dynamically switches between themes, and some themes have extra definitions. These defs might appear as null when it's not relevant. This recent change chokes on that change.
Your environment
npx @mui/envinfo
```
Don't forget to mention which browser you used.
Output from `npx @mui/envinfo` goes here.
```
Steps to reproduce
https://github.com/mui/material-ui/pull/41367/files#r1586868393
I can put some effort in making an environment, but I hope the comment above is enough using code inspection to suffice for "steps to reproduce". Requested by @siriwatknp, suggested fix included in the PR comment above.
Current behavior
Themes with a undefined/null value will crash
Expected behavior
While not happy path,
Switch
should tolerate themes with a value that is undefined/null.Context
Our application dynamically switches between themes, and some themes have extra definitions. These defs might appear as
null
when it's not relevant. This recent change chokes on that change.Your environment
``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```npx @mui/envinfo
Search keywords: switch theme undefined null crash