Overview
The live, canonical view of a conversation’s messages. Results are stored in Redux and kept in sync byChatProvider socket events, so new messages, edits, reactions and reply-count changes appear in real time, and state is shared with useSendMessage (optimistic inserts), unread tracking and reconnect catch-up. Can be used for the main message stream or for a specific thread (by passing parentMessageId).
Requires
ChatProvider in the component tree.Usage Example
Props
string
required
The ID of the conversation to load messages for.
string | null
When provided, loads thread replies for this parent message ID instead of the main stream. Replies are sorted ascending (oldest first);
loadOlder fetches newer replies.number
Number of messages per page. Defaults to
50.boolean
When
true, the server populates the files field on each message. Omitted by default to keep payloads small.boolean
When
true, each message carries its reputation-grant summary at message.grants — { total, count, viewerTotal } over positive grants. Populated by the reputation bundle; on a project without it the summary comes back zero-filled rather than missing.Returns
ChatMessage[]
The loaded messages in ascending order (oldest first). See ChatMessage.
boolean
true while a fetch is in progress.boolean
true if there are more messages to load.() => Promise<void>
For the main stream: fetches messages older than the oldest currently loaded.
For threads: fetches the next page of newer replies.
No-ops if
loading is true or hasMore is false.Notes
- New messages that arrive via the socket (
message:created) are added to the store automatically — no manual refetch needed. Thread replies go to their thread, never to the main stream. - After the socket reconnects, a thread loads the replies sent while it was offline. The main stream’s catch-up is done by
ConversationProvider(see Missed Messages After a Reconnect). - For integration guidance, see Chat: Messages.

