How to use Styled Components with Material UI (MUI) in React
1 min readMar 9, 2023
I just worked on a project that used both Material UI (MUI) and Styled Components in React (well, Next.JS but same same).
Anywho, I was trying to style a simple MU IDialog box with Styled Components and for the life of me I just couldn’t do it. I tried targeting the Dialog classNames directly but no dice, and because we’re on v4 of MUI, I couldn’t use sx
.
Eventually I asked my boss for help and he said I needed to override the styles in the Theme Provider… what??! Hell’s no. That didn’t sound like a…