rooks
Version:
Collection of awesome react hooks
14 lines (13 loc) • 616 B
TypeScript
/**
* useMediaMatch
*
* A react hook that signals whether or not a media query is matched.
*
* @param query The media query to signal on. Example, `"print"` will signal
* `true` when previewing in print mode, and `false` otherwise.
* @param defaultServerRenderedValue Optional value to return when window is undefined (server-side rendering). Defaults to false.
* @returns Whether or not the media query is currently matched.
* @see https://rooks.vercel.app/docs/hooks/useMediaMatch
*/
declare function useMediaMatch(query: string, defaultServerRenderedValue?: boolean): boolean;
export { useMediaMatch };