@react-hook/window-size
Version:
React hooks for updating components when the size of the `window` changes.
16 lines (15 loc) • 466 B
TypeScript
export interface ThrottledWindowSizeOptions {
initialWidth?: number
initialHeight?: number
fps?: number
leading?: boolean
}
export declare const useWindowSize: (
options?: ThrottledWindowSizeOptions
) => readonly [number, number]
export declare const useWindowHeight: (
options?: Omit<ThrottledWindowSizeOptions, 'initialWidth'>
) => number
export declare const useWindowWidth: (
options?: Omit<ThrottledWindowSizeOptions, 'initialHeight'>
) => number