Next.js Discord

Discord Forum

Where to put `StyledEngineProvider` so that CSS modules are not overridden by MUI styles?

Unanswered
Zack posted this in #help-forum
Open in Discord
Hi all,

I've been struggling to figure out how to prevent my CSS modules from getting overridden as described in this post - https://stackoverflow.com/questions/73731487/css-module-classes-work-on-development-but-are-overridden-on-production as I can't figure out where to put my StyledEngineProvider. I am using the Pages Router. Would I put it in _app,tsx or in layout.tsx, or somewhere else entirely? Thank you!

0 Replies