use-previous
Get the previous value of a state
Import
Source
Docs
Package
Usage
use-previous
hook stores the previous value of a state in a ref,
it returns undefined
on initial render and the previous value of a state after rerender:
Current value:
Previous value: