Documentation
Hooks
useResizeObserver

useResizeObserver

Handle the ResizeObserver (opens in a new tab) API.

The content box is the box in which content can be placed, meaning the border box minus the padding and border width. The border box encompasses the content, padding, and border.

Type Definitions

const useResizeObserver: <T extends HTMLElement = HTMLDivElement>(args: ResizeObserverOptions & {
    handler: ResizeObserverCallback;
    ref?: React.RefObject<T> | null;
}) => {
    ref: React.RefObject<T>;
    observer: React.MutableRefObject<ResizeObserver | undefined>;
};