mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-03-31 04:47:21 +02:00
9 lines
202 B
TypeScript
9 lines
202 B
TypeScript
import { useEffect, useRef } from 'react';
|
|
|
|
export const usePrevious = <T>(value: T) => {
|
|
const ref = useRef<T>();
|
|
useEffect(() => {
|
|
ref.current = value;
|
|
}, [value]);
|
|
return ref.current;
|
|
};
|