import { useResizeObserver } from "https://deno.land/x/netzo@0.4.72/deps/usehooks-ts.ts";
Custom hook for observing the size of an element using the ResizeObserver API.
Examples
const myRef = useRef(null);
const { width = 0, height = 0 } = useResizeObserver({
ref: myRef,
box: 'content-box',
});
const myRef = useRef(null); const { width = 0, height = 0 } = useResizeObserver({ ref: myRef, box: 'content-box', });
Parameters
options: UseResizeObserverOptions<T>
- The options for the ResizeObserver. (default is
{}
).