@winglet/react-utils
Version:
React utility library providing custom hooks, higher-order components (HOCs), and utility functions to enhance React application development with improved reusability and functionality
13 lines (12 loc) • 472 B
TypeScript
/**
* Returns the current browser window size and automatically updates when the user resizes the window.
* Useful for responsive components that need to adapt to window size changes.
* @returns An object containing width and height properties of the current window
* @example
* const { width, height } = useWindowSize();
* return <div>Width: {width}, Height: {height}</div>;
*/
export declare const useWindowSize: () => {
width: number;
height: number;
};