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

Définition

La définition TypeScript de l'interface telle que trouvée dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.

typescript

API

Propriétés

Chaque propriété déclarée par cette interface, avec son type, son caractère optionnel et sa valeur par défaut.

resizeRef
requis
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
requis
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.

Écosystème

Utilisé par

Composants et composables qui étendent ou consomment cette interface.

Usage

Exemples

Extraits de code prêts à coller utilisant cette interface.

Reading dimensions from useResizeObserver

typescript