better-chatbot / src /hooks /use-latest.ts
Bot
Initial commit for HF Spaces
05c5ed5
Raw
History Blame Contribute Delete
145 Bytes
import { useRef } from "react";
export const useToRef = <T>(value: T) => {
const ref = useRef(value);
ref.current = value;
return ref;
};