useLatest

A hook that returns the latest value, that could avoid the closure problem.

const latestValueRef = useLatest<T>(value: T): MutableRefObject<T>;

Example

Basic usage of useLatest hook.

API

PropertyDescriptionTypeDefault
---
ON THIS PAGE