UNPKG

@thibault.sh/hooks

Version:

A comprehensive collection of React hooks for browser storage, UI interactions, and more

15 lines (12 loc) 418 B
import { RefObject } from 'react'; interface ElementSize { width: number; height: number; } /** * Hook that tracks an element's dimensions using ResizeObserver * @param elementRef - React ref object pointing to the target element * @returns Object containing current element width and height */ declare function useElementSize(elementRef: RefObject<HTMLElement>): ElementSize; export { useElementSize };