IResizeState

interface
Utilities & Internals

Return shape of the `useResizeObserver` composable — a ref to the observed element and a deep-readonly ref to its most recent `DOMRectReadOnly` measurements.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

resizeRef
required
Ref<T | null | undefined>
Attach this ref to the element you want to observe. The ResizeObserver starts watching as soon as the ref is populated and stops when it becomes null/undefined.
contentRect
required
DeepReadonly<Ref<DOMRectReadOnly | undefined>>
Reactive snapshot of the last measured DOMRectReadOnly. Undefined before the first measurement or when the element is detached. Deep-readonly to prevent accidental mutation.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Reading dimensions from useResizeObserver

typescript