Skip to content

Commit f730d63

Browse files
committed
fix(appkit-ui): widen ChatMessages containerRef to ref-callback shape
Follow-up to the parent fix that switched `useScrollToBottom` from `useRef` to a state-backed ref callback. `ChatMessages` previously typed `containerRef` as `RefObject<HTMLDivElement | null>`, which no longer matches the hook's return shape — the public type signature needs to follow. Behavior is unchanged at runtime since the prop is only ever forwarded to a JSX `ref={...}`, which accepts both ref shapes. Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
1 parent 3bf0196 commit f730d63

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

packages/appkit-ui/src/react/chat/app/chat-messages.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { UseChatHelpers } from "@ai-sdk/react";
22
import type { ChatStatus, UIMessage } from "ai";
3-
import type { ReactNode, RefObject } from "react";
3+
import type { ReactNode } from "react";
44
import { cn } from "../../lib/utils";
55
import { Button } from "../../ui/button";
66
import { ArrowDownIcon, DbIcon } from "../db-icons";
@@ -15,7 +15,12 @@ import type { ChatToolCallProps } from "./chat-tool-call";
1515
interface ChatMessagesProps<TMessage extends UIMessage = UIMessage> {
1616
messages: TMessage[];
1717
status: ChatStatus;
18-
containerRef: RefObject<HTMLDivElement | null>;
18+
/**
19+
* Scroll-container ref. `useScrollToBottom` returns a ref callback
20+
* (not a RefObject) so the listener attaches when the node mounts —
21+
* forward whatever the hook gives you.
22+
*/
23+
containerRef: (node: HTMLDivElement | null) => void;
1924
isAtBottom: boolean;
2025
scrollToBottom: () => void;
2126
approvals: Map<string, ApprovalEntry>;

0 commit comments

Comments
 (0)