not working on window-resizing
sagartmg opened this issue · 1 comments
sagartmg commented
while using toggle-device-toolbar in chrome, it does work but while resizing chrome window, it doesnot
// code
// sizes according to bootstrap
const isDesktopOrLaptop = useMediaQuery({ minDeviceWidth: 1200 })
const isTablet = useMediaQuery({ maxDeviceWidth: 1199, minDeviceWidth: 768 })
const isMobileDevice = useMediaQuery({ maxDeviceWidth: 767 })
and in render method
Device Test!
{isDesktopOrLaptop &&
You are a desktop or laptop
}{isTablet &&
You are a tablet or mobile phone
}{isMobileDevice &&
mobile mobile phone
}sagartmg commented
fixed using minWidth instted of minDeviceWidth in
const isDesktopOrLaptop = useMediaQuery({ minDeviceWidth: 1200 })
const isTablet = useMediaQuery({ maxDeviceWidth: 1199, minDeviceWidth: 768 })
const isMobileDevice = useMediaQuery({ maxDeviceWidth: 767 })