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