Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / hooks / usePrevious.ts
blob1e0845c06a3af4cffec8b6e92feb1486ac9b817a
1 import { useEffect, useRef } from 'react';
3 const usePrevious = <T>(value: T) => {
4     const ref = useRef<T>();
5     useEffect(() => {
6         ref.current = value;
7     });
8     return ref.current;
9 };
11 export default usePrevious;