Wrong CSS classes take precedence
See original GitHub issueTL;DR
Needed to npm uninstall @mui/x-data-grid
and npm install @mui/x-data-grid@next
After migrating from v4 to v5, and having refactored out @mui/styles, I now see that my MuiButtons, when rendered, have classes on the form: css-xyz1234-MuiButtonBase-root-MuiButton-root.
On some pages in my app, styles coming from css-xyz1234-MuiButtonBase-root-MuiButton-root are overridden by the styles coming from MuiButton-root, which causes buttons to seem unstyled.
On other pages, the styles from css-xyz1234-MuiButtonBase-root-MuiButton-root correctly take precedence, giving buttons the intended styling.
If I inspect a MuiButton component in the docs, I see no classes of the long form, but instead css-xyz1234.
I tried using StyledEngineProvider as described in https://mui.com/guides/migration-v4/#style-library without effect.
Although I suspect that this is an issue with my project and not material-ui, I’m posting this since I’m out of ideas on how to move forward and hoping that it might help others migrating.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (6 by maintainers)
I can definitely see
@material-ui/core
, it comes as being dependency on@mui/x-data-grid
I believe. I think you need to upgrade to v5 on@mui/x-data-grid
too, but probably @m4theushw can provide more info on this. The goal is to try to remove @material-ui/core everywhere from package-lock.jsonYep, I did! Updated original question with TL;DR 😃