Thread

Renders thread replies for a message, with an input for new replies. Internally uses MessageList and MessageInput.

Best Practices

  • Render Thread within Channel and pass thread/threadList correctly.
  • Use closeThreadOnDismount to keep channel state in sync.
  • Avoid heavy customization; override MessageList/MessageInput only when needed.
  • Keep thread input focused only when appropriate (autoFocus).
  • Use reloadThread/loadMoreThread instead of manual pagination.

General Usage

import {
  OverlayProvider,
  Chat,
  Channel,
  Thread,
} from "stream-chat-react-native";

const App = () => {
  return (
    <OverlayProvider>
      <Chat client={client}>
        <Channel channel={channel} thread={message} threadList>
          <Thread />
        </Channel>
      </Chat>
    </OverlayProvider>
  );
};

Props

additionalMessageInputProps

Additional props for underlying MessageInput component.

Type
Object

additionalMessageListProps

Additional props for underlying MessageList component.

Type
Object

autoFocus

When true, the input auto-focuses on mount.

TypeDefault
Booleantrue

closeThreadOnDismount

Closes thread on dismount, defaults to true.

TypeDefault
Booleantrue

client

Stream Chat client instance.

closeThread

Unsets the thread and thread messages in the Channel state.

Type
Function

disabled

When true, the underlying input box will be disabled.

TypeDefault
Booleanfalse

loadMoreThread

Loads more messages for the thread. Returns a promise.

Type
() => Promise<void>

onThreadDismount

Called when Thread unmounts.

Type
Function

parentMessagePreventPress

Boolean to enable/disable parent message press.

TypeDefault
Booleantrue

reloadThread

Reloads the thread and thread messages.

Type
function

thread

Can be a LocalMessage or ThreadType. Setting it indicates a thread is open. Both types are interchangeable.

With Thread, this displays the thread. With the standard MessageList, it keeps singleton components in OverlayProvider in sync.

Set thread on all Channel components when a thread is open.

Type
object

UI Component Props

MessageList

TypeDefault
ComponentTypeMessageList

MessageInput

TypeDefault
ComponentTypeMessageInput