Skip to content

usePrevious ​

Category
Utilities

Hook that returns the previous value

typescript
import { usePrevious } from '@siberiacancode/reactuse';

Usage ​

typescript
const prevValue = usePrevious(value);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
valueValue-The value to get the previous value

Returns

Value

Contributors ​

Source • Demo