Duplicate Button/ButtonBase classNames starting from @mui/material v5.10.7 onwards #35854
Closed
2 tasks done
Labels
component: button
This is the name of the generic UI component, not the React module!
duplicate
This issue or pull request already exists
Duplicates
Maybe related #33332
Latest version
Steps to reproduce 🕹
Link to live example:
as expected:
MUI 5.10.6 sandbox
problematic:
MUI 5.10.7 sandbox
MUI latest sandbox from docs
diff of
<Button>
component5.10.6 on left, 5.10.7 on right
Steps:
@mui/material
to any version newer than 5.10.6Current behavior 😯
Duplicated root styles are applied to
Button
and possibly other components.EDIT: I do see this occurring with the other components such as
Checkbox
,Radio
. I understand that Emotion does do eager injection ofclassNames
, so maybe this is expected behavior. I just wanted to confirm that was the case. If it is, are there any recommendations/methods to post-process via babel/webpack to remove the duplicate injected styles?Expected behavior 🤔
No duplicate root styles.
Context 🔦
I suspect it's coming from the changes in #34451 and may also be happening with other components. I don't see anything visually problematic but the DOM does increase in size due to the duplicated classNames being injected.
Your environment 🌎
npx @mui/envinfo
Issue occurs on all browsers
The text was updated successfully, but these errors were encountered: