-
Joel Jeremy Marquez authored
* ESLint no-default-exports 10 - all desktop-client src folders except icons * Release notes
Joel Jeremy Marquez authored* ESLint no-default-exports 10 - all desktop-client src folders except icons * Release notes
usePrevious.ts 237 B
import { useEffect, useRef } from 'react';
export function usePrevious<T = unknown>(value: T): T | undefined {
const ref = useRef<T | undefined>();
useEffect(() => {
ref.current = value;
}, [value]);
return ref.current;
}