Skip to content

useLatest ​

Category
Utilities

Hook that returns the stable reference of the value

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

Contributors ​

Source • Demo