-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Remove styled
from @material-ui/styles
in core
#26101
Conversation
@material-ui/core: parsed: -0.19% 😍, gzip: -0.20% 😍 |
const { className, ...other } = props; | ||
const classes = useStyles(); | ||
|
||
return <MarkdownElement className={clsx(classes.root, className)} {...other} />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MarkdownElement
is build with JSS, we cannot override with emotion currently, so just temporary replacing styled()
with makeStyles()
.
@@ -26,6 +26,11 @@ function rewriteImportPath(importPath) { | |||
return importPath.replace(stylesSrcPath, '@material-ui/styles'); | |||
} | |||
|
|||
const systemSrcPath = path.posix.join('..', 'material-ui-system', 'src'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build was failing without this, as the system is referenced in the experimentalStyled()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can strip these fixes in TypeScript 4.3. Their current dev build no longer requires manual rewriting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, I was confused why it was failing at the beginning. It's great that we can drop them 👍
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
One step toward the removal of
@material-ui/styles
in v6.Breaking changes
The
styled
JSS utility is no longer exported from@material-ui/core/styles
. You can use@material-ui/styles/styled
instead. Make sure to add aThemeProvider
at the root of your application, as thedefaultTheme
is no longer available. If you are using this utility together with@material-ui/core
, it's recommended you use theThemeProvider
component from@material-ui/core/styles
instead.