Issue with useMediaQuery({minWidth: <value>, maxWidth: <value>})
See original GitHub issueconst isLaptop = useMediaQuery({ minWidth: 992, maxWidth: 1199});
const isDesktop = useMediaQuery({ minWidth: 1200, maxWidth: 1919 });
console.log('laptop', isLaptop, 'desktop', isDesktop);
This will log laptop false desktop false in screensize 1199;
Expected output : laptop true desktop false
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
CSS Media Min-Width & Max-Width Queries - How They Work
Learn to use media max width and min width to develop responsive emails for ... This can be used to address layout or...
Read more >Media min-width & max-width - css - Stack Overflow
First, the issue was when my I resized my browser with max-device-with it worked on the phone but not in the broswer, without...
Read more >minWidth and maxWidth same value, dupe content, expected?
CSS Media Queries will apply both selectors for min and max width when the values are the same: @media (max-width: 768px) { }...
Read more >useMediaQuery - Chakra UI
Return value#. The useMediaQuery hook returns an array of booleans, indicating whether the given query matches or queries match. Why an array? useMediaQuery...
Read more >How to Set Width Ranges for Your CSS Media Queries
Once the max-width property gets a value assigned to it, all the styles within that particular media query will be applied to any...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tacmoktan My question (and why I linked the previous stackoverflow post) - have you tried this using a plain CSS media query, and is the result the same? If so - the issue is not this library, it is just how CSS media queries work - you need to overlap them sometimes for breakpoints like this (see the StackOverflow post for more info).
Ok. I tried it. Seems like that’s how CSS media query works. My bad. Thank you for your response.