Material-UI Rendering Bugs in production / build

I had the exact same issue. Turned out that Webpack would mess around with Material UI’s rules of JSS precedence. You need to manually override the injection order using the index option.

In your makeStyles() or withStyles(), add {index: 1}:

//Hook
const useStyles = makeStyles({
    // your styles here
}, {index: 1})

// HOC 
MyComponent = withStyles({
    // your styles here
}, {index: 1})(MyComponent)

Leave a Comment