useResizeObserver

Wraps the ResizeObserver API to detect size changes of an element.

Wraps the ResizeObserver API​ to detect size changes of an element. The observer lifecycle is managed and cleaned up automatically.

Import#

import { useResizeObserver } from '@volue/wave-react';

Example#


API reference#

Arguments#

Prop
Type
Default
target*
Element | RefObject<Element> | null
—
callback*
ResizeObserverCallback
—

Returns#

void