import { useRef } from 'react'; export const useRefCopy = (value: T) => { const ref = useRef(value); ref.current = value; return ref; };