Returns true if the window matches the media query, or false otherwise.
true
false
The media query to match.
A value returned during the initial render.
const isMatched = useMediaQuery('(min-width: 600px)'); Copy
const isMatched = useMediaQuery('(min-width: 600px)');
Returns
true
if the window matches the media query, orfalse
otherwise.