Skip to content

useMediaQuery ​

Category
Browser

Hook that manages a media query

typescript
import { useMediaQuery } from '@siberiacancode/reactuse';

Usage ​

typescript
const matches = useMediaQuery('(max-width: 768px)');

Demo ​

Api ​

Parameters

NameTypeDefaultNote
querystring-The media query string

Returns

boolean

Contributors ​

Source • Demo