use-resize-observer
Observe the size change of a reference.
import {
useResizeObserver,
useResizeObserverState,
} from "@atomico/hooks/use-resize-observer";
useResizeObserver(
ref,
(rect) => void
);
Where:
ref
:Ref
, reference to observe the resizing.- width
- height
- x
- y
- top
- right
- bottom
- left
const rect = useResizeObserverState(ref);
Where:
ref
:Ref
, reference to observe the resizing.- width
- height
- x
- y
- top
- right
- bottom
- left
Last modified 1yr ago