gregnb / gregnb/mui-datatables
Remove @mui/styles according to migration from mui v4 to v5
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 906
- PR merge metrics
- No merged PRs in 30d
Description
@mui/styles will be deprecated in mui v6 you can read about this here https://github.com/mui-org/material-ui/issues/26571
And even in guide migration from v4 to v5 exist steps for removing @mui/styles from the project here: https://mui.com/guides/migration-v4/#migrate-from-jss
I was faced with an issue that mui-datatables still used @mui/styles and I can't remove it from the project.
Think that it's a bug, because:
- it increases the size of bundle without any benefits,
- using not last version of mui functional: mui 5 using emotion/styled/sx, but mui v4 using jss. That means now mui-datatables have two different ways for styles.
In my opinion, it`s should be migrated from @mui/styles as soon as possible.
Mui 5 provide for us two ways to remove it: https://mui.com/guides/migration-v4/#migrate-from-jss
But the most similar as makeStyles is this: https://dev.to/atonchev/material-ui-5-the-easiest-way-to-migrate-from-makestyles-to-emotion-1i9l
The fastest solution is to add @mui/styles to peerDependency #1820 that allow for devs to remove @mui/styles from their projects, and then step by step doing a migration from @mui/styles to emotion.
| Tech | Version |
|--------------|---------|
| Material-UI | 5.2.1 |
| MUI-datatables | 4.0.0 |
| React | 17.0.2 |
Contributor guide
No contributing guide indexed for this repository
Research direction
Review the MUI v4-to-v5 migration guide and inspect the repository's uses of @mui/styles. Determine the migration scope across the project, then verify that the package is no longer required and that the existing table styling still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100