Skip to content
zenui/react-hooks

useLatest

Returns a ref that always holds the latest value. Read it inside timers, listeners and effects to avoid stale closures without restarting them.

Level
Basic
Since
v2.1.0
import {useLatest} from '@zenuilabs/react-hooks';
Loading demo_

More in Utilities