-
-
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
[useMediaQuery] Improve useWidth demo #16611
Conversation
No bundle size changes comparing 2c5d99e...8dbe612 |
@@ -3,21 +3,19 @@ import { ThemeProvider, useTheme } from '@material-ui/styles'; | |||
import useMediaQuery from '@material-ui/core/useMediaQuery'; | |||
import { createMuiTheme } from '@material-ui/core/styles'; | |||
|
|||
/** | |||
* Be careful using this hook. It only works because the number of |
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 use the same strategy in withWidth.js. It supports theme breakpoints customization. what's the motivation for using a different one? Should we use the same strategy everywhere?
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.
@siriwatknp I went forward with the simplest possible fix. I'm still curious to hear why being explicit about all the breakpoints would be better. We could continue the discussion for another pull request. Thanks!
Fix #16460