We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
messagesEndRef
useRef
1 parent ce8e942 commit ea472ddCopy full SHA for ea472dd
app/components/chat.tsx
@@ -66,7 +66,7 @@ const Chat = ({
66
const [threadId, setThreadId] = useState("");
67
68
// automitcally scroll to bottom of chat
69
- const messagesEndRef = useRef(null);
+ const messagesEndRef = useRef<HTMLDivElement | null>(null);
70
const scrollToBottom = () => {
71
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
72
};
0 commit comments