import { useRef } from "react"; export function useRefSync(value: T) { const ref = useRef(value); ref.current = value; return ref; }