Appearance
usePrevious
Holds the previous value of a source
Demo
Usage
tsx
import { usePrevious } from '@reause/core'
const previous = usePrevious(counter) // `undefined` until the first change
// after each change, `previous` is the value the source had before itType Declarations
ts
export function usePrevious<T>(value: T): T | undefined
export function usePrevious<T>(value: T, initialValue: T): T