export interface Rect { width: number; height: number; x?: number; y?: number; } /** * Efficiently observe size changes on an element. Depends on the `ResizeObserver` api, * and polyfills are needed in older browsers. * * ```ts * const [ref, attachRef] = useCallbackRef(null); * * const rect = useResizeObserver(ref); * * return ( *