Skip to content

useLatest ​

Hook that returns the stable reference of the value

utilities
test coverage
Last changed: last month

Installation ​

Library
CLI
Manual
typescript
import { useLatest } from '@siberiacancode/reactuse';

Usage ​

typescript
const latestValue = useLatest(value);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
valueValue-The value to get the previous value

Returns

Value

Source ​

Source • Demo

Contributors ​

D
debabin
debabin

Released under the MIT License.