Overview
A convenience hook that wrapsuseLiveChatMessages and useSendMessage for a specific message thread. Returns the thread’s replies and a sendReply function that automatically sets parentMessageId.
Requires
ChatProvider in the component tree.Usage Example
Props
Returns
Thread replies in ascending order (oldest first). See ChatMessage.
The last load failure, or
null. Cleared when the next load starts; loadMore() retries it. Shared by every mounted hook showing the same thread. A SublayError.Fetches the next page of newer replies, or retries the load that failed. Does nothing while a page is loading or when there is nothing more. Never rejects: a failure lands in
error.Reloads the thread from its first reply. Never rejects: a failure lands in
error.Sends a reply to this thread. Accepts the same parameters as
useSendMessage except parentMessageId (set automatically). Resolves to the same SendMessageResult as useSendMessage: the server-confirmed ChatMessage, without reactionCounts, userReactions and grants, with localId echoed back.Notes
- The thread is live: new replies (including your own), edits, deletions, removals and reactions appear as they happen, and replies sent while the socket was disconnected are loaded when it reconnects.
- For integration guidance, see Chat: Threads.

