Skip to content
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

Merged
merged 3 commits into from
Jul 19, 2019

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Jul 16, 2019

Fix #16460

@mui-pr-bot
Copy link

mui-pr-bot commented Jul 16, 2019

No bundle size changes comparing 2c5d99e...8dbe612

Generated by 🚫 dangerJS against 8dbe612

@joshwooding joshwooding added the package: material-ui Specific to @mui/material label Jul 16, 2019
@@ -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
Copy link
Member

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?

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation hook: useMediaQuery labels Jul 16, 2019
@oliviertassinari oliviertassinari changed the title update useWidth logic and demo [useMediaQuery] Improve useWidth demo Jul 16, 2019
@joshwooding joshwooding removed the package: material-ui Specific to @mui/material label Jul 16, 2019
Copy link
Member

@oliviertassinari oliviertassinari left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation hook: useMediaQuery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useMediaQuery return wrong width
4 participants