useLiveRef
Returns a ref that always holds the latest value, synchronized via layout effect.
Keeps a ref object in sync with the latest value using a layout effect. Useful for accessing the current value inside callbacks without adding it to dependency arrays.
Import#
import { useLiveRef } from '@volue/wave-react';
Example#
API Reference#
Arguments#
Prop | Type | Default |
|---|---|---|
value* | T | — |
Returns#
RefObject<T>