ThreadListItemContext

ThreadListItemContext is provided by ThreadListItem. If you are not familiar with the React Context API, see the React docs.

ThreadListItemContext must be used within ThreadList because it depends on ThreadsContext.

Best Practices

  • Use useThreadListItemContext inside thread list items only.
  • Keep per-item rendering lightweight to preserve scroll performance.
  • Use dateString for consistent timestamps.
  • Handle ownUnreadMessageCount as a badge, not a control.
  • Avoid extra API calls; use the provided thread and parentMessage.

Basic Usage

Consume ThreadListItemContext in any child of ThreadList:

import { useContext } from "react";
import { ThreadListItemContext } from "stream-chat-react-native";

const value = useContext(ThreadListItemContext);

Alternatively, use the useThreadListItemContext hook.

import { useThreadListItemContext } from "stream-chat-react-native";

const value = useThreadListItemContext();

Values

Value Description Type
channel Channel instance from the Stream Chat client. Channel
dateString A formatted date string for the thread timestamp. Default format: HH:MM. string | number | undefined
deletedAtDateString A formatted date string for when the thread's parent message was deleted. string | number | undefined
draftMessage The thread's saved draft reply, if one exists. DraftMessage | undefined
lastReply Latest reply message in the thread. LocalMessage
ownUnreadMessageCount Unread message count for the thread. number
parentMessage Parent message of the thread. LocalMessage
thread Instance of Thread used to read more data or pass to onThreadSelect. Thread
Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat React Native v9: <Your Question>