UNPKG

@supunlakmal/hooks

Version:

A collection of reusable React hooks

9 lines (8 loc) 324 B
/** * Custom hook to get the previous value of a prop or state. * * @template T The type of the value to track. * @param {T} value The current value. * @returns {T | undefined} The value from the previous render, or undefined on the initial render. */ export declare const usePrevious: <T>(value: T) => T | undefined;