-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[material-ui] Support theme scoping in useMediaQuery
#44339
Conversation
Netlify deploy previewhttps://deploy-preview-44339--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
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.
LGTM 😊
Just a heads up that this change may require users to make code changes. We had some code like this: const isMobile = useMediaQuery<Theme>((theme) => theme.breakpoints.down('sm')); and when we updated to 6.1.7 our build started failing on this line with
Granted, it's easy enough to remove the |
Thanks for letting us know @seanparmelee! @siriwatknp seems like we should've added the type argument here, right? https://github.com/mui/material-ui/pull/44339/files#diff-4a4c308f0f78aea6f2ff8d60829ebcbef84029157da66ce2c6a8f4411b1fbbc8 |
Just spun up a dev server (we're using Next.js 14.2.17) with this version of MUI and received this error when navigating to our app:
If I disable turbopack and try again, the error is:
I don't see these errors when running in production mode (i.e. I can log a separate issue for this if you'd like. |
closes #44335
Added a test and updated the types to use the Material UI Theme.
Review recommendation: hide whitespace