UNPKG

@gravity-ui/graph

Version:

Modern graph editor component

16 lines (15 loc) 424 B
/** * Hook for tracking the previous value of a state. * * @example * ```tsx * const [count, setCount] = useState(0); * const prevCount = usePrevious(count); * * ``` * * @template T - Type of the value being tracked * @param value - Current value whose previous state needs to be tracked * @returns Previous value or undefined on first render */ export declare function usePrevious<T>(value: T): T | undefined;