MUI Theme: Components default properties not applied if React is rendered in shadow DOM #45699
Labels
customization: theme
Centered around the theming features
support: question
Community support but can be turned into an improvement
Steps to reproduce
I created a react application which is rendered within a shadow DOM. I followed the documentation for Mui with shadow DOM.
The same logic was working with Mui V4 using React 18. Now with React 19 and Mui V6, it doesn't work anymore.
Steps:
Current behavior
Default properties like
fullWith
orvariant
for MuiButton orcontainer
for components using portal were not applied to the components and therefore are not working correctly as long as I not provide the properties to each component instance explicitly.Expected behavior
The components use the default properties defined in theme
Context
I build complex formular applications with vite, which will be embedded in an other 3rd-party application. Therefore it is essential to have the shadow DOM. The provided example is just a example to isolate the issue.
The workaround for this issue is, to set the default properties explicitly on each instance, what is not really a solution for a larger application.
Your environment
I used Firefox 136.0.2 and Chrome for dev and tests.
npx @mui/envinfo
Search keywords: shadow DOM theme Emotion
The text was updated successfully, but these errors were encountered: