Last updated
Last updated
You upgraded to MUIv5 using tss-react but the somme styles doesn't apply the same way they uses to?
You can fix the indivudual problems but it's a very time consuming process.
Setting up emotion like that will probably fix all your issues:
In theory, when TSS and MUI uses the same emotion cache, the styles that you provide via className or classes should always take priority over MUI's default styles.
By explicitly telling MUI to use one cache and TSS to use another and by making sure the MUI styles are injected before in the <head />
(prepend: true
) you ensure that TSS-generated styles always overwrite MUI's default styles.
Link to the setp instruction: .
If your issues are fixed by doing this, please so I can address the root cause of the problem by issuing a PR on the MUI repo.
It's almost always the case but in involving media queries on the MUI side, it isn't.
You always have the option to artificially increase the specificity with or using !important
but if you are just upgrading to MUI v5 you probably don't want to spend hours troubleshooting issues one by one.