@supunlakmal/hooks
Version:
A collection of reusable React hooks
9 lines (8 loc) • 405 B
TypeScript
/**
* Custom hook for tracking the state of a CSS media query.
*
* @param {string} query The CSS media query string (e.g., '(max-width: 768px)').
* @returns {boolean} Returns `true` if the media query matches, `false` otherwise.
* Returns `false` during server-side rendering or before the first client-side check.
*/
export declare const useMediaQuery: (query: string) => boolean;