Deprecated
- Use
useResizeObserver
instead. A hook for tracking the size of a DOM element.
import { useElementSize } from "https://deno.land/x/netzo@0.5.63/deps/usehooks-ts.ts";
Examples
const [ref, { width = 0, height = 0 }] = useElementSize();
// or
const { ref, width = 0, height = 0 } = useElementSize();
const [ref, { width = 0, height = 0 }] = useElementSize(); // or const { ref, width = 0, height = 0 } = useElementSize();
return (