Info:
This is documentation for Stream Chat React SDK v12, which is no longer actively maintained. For up-to-date documentation, see the latest version (v14).

ThreadContext

ThreadContext - just like any other React context - is used for dependency injection. What makes it different in this case is ThreadProvider.

ThreadProvider

Is a provider which wraps Channel component and takes Thread instance as a value. The Channel wrapper acts as a temporary measure to make Thread component compatible with the new architecture which relies on Thread instance. The reliance on channel is temporary and will become deprecated in the future.

Thread component newly prioritizes Thread instance if rendered under ThreadProvider otherwise falls back to accessing thread from Channel state.

Basic Usage

import { Thread, ThreadProvider } from "stream-chat-react";

<ThreadProvider thread={/*...*/}>
  <Thread />
</ThreadProvider>;
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 v12: <Your Question>