Skip to content

useElementSize ​

elements
test coverage
Last changed: 24 days ago

Hook that observes and returns the width and height of element

typescript
import { useElementSize } from '@siberiacancode/reactuse';

Usage ​

typescript
const { value } = useElementSize(ref);
// or
const { ref, value } = useElementSize();

Demo ​

Api ​

Parameters

NameTypeDefaultNote
targetHookTarget-The target element to observe

Source ​

Source • Demo

Contributors ​

Avatardebabin
AvatarAlexander Lee
Avatarbabin
AvatarVLADISLAW9

Released under the MIT License.