reactuals
Version:
A useful package providing a collection of 50+ React hooks and utilities to simplify React development.
11 lines (10 loc) • 335 B
TypeScript
/**
* Tracks the state of a media query.
* @param query - The media query string.
* @returns A boolean indicating if the query matches.
*
* Example:
* const isLargeScreen = useMediaQuery("(min-width: 1024px)");
* if (isLargeScreen) console.log("Large screen");
*/
export declare function useMediaQuery(query: string): boolean;