Open memo-saldana opened 10 months ago
Thanks for pointing this out @memo-saldana! @mui/styles
is indeed a legacy package that's no longer recommended, and the doc you linked is a little confusing.
I think that confusion stems from the fact that both @mui/material/styles
AND @mui/styles
both provide something called styled
—but that something is actually not the same thing in the two packages.
In that section that you linked from the Migration Guide, what it's saying is that the older JSS-based styled
utility is no longer exported from @mui/material/styles
, and so if you still need it, you must import from it @mui/styles
(the deprecated package). By contrast, the styled
utility that is now exported by @mui/material/styles
uses Emotion under the hood rather than JSS, so the way it works slightly different (hence the breaking changes). Does that make sense?
Duplicates
Related page
https://mui.com/material-ui/migration/v5-style-changes/#styled
Kind of issue
Unclear explanations
Issue description
I was looking for ... and it appears that ... I was looking into how to create reusable styled components. It appears that there are a couple of places from which I can import the utility fn, but it is not clear which is the correct one (or if all are the same?).
Migration guide says to change any usages of
But...
@mui/styles
states that this is a legacy api.styled
states to use@mui/material/styles
@mui/material/styles
From the amount of ocurrences, seems like migration docs is outdated. Maybe its the same under the hood? Could anyone shed some light here? Thanks!
Context 🔦
I just migrated a project from v4 to v5.