This is documentation for Stream Chat React Native SDK v5, which is nolonger actively maintained. For up-to-date documentation, see the latest version (v6).

Thread

Component to render thread replies for a message, along with and input box for adding new thread replies. This component internally uses MessageList and MessageInput components.

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>
          <partial id="chat-sdk/react-native/v5/_partials/common-content/ui-components/channel/props/thread"></partial>
        </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, input box will be auto focused upon mounting.

TypeDefault
Booleantrue

closeThreadOnDismount

Closes thread on dismount, defaults to true.

TypeDefault
Booleantrue

client

Instance of StreamChat client.

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

Function which gets called when Thread component un-mounts.

Type
Function

parentMessagePreventPress

Boolean to enable/disable parent message press.

TypeDefault
Booleantrue

reloadthread

Reloads the thread and thread messages.

Type
function

thread

Can be either a MessageType object or a ThreadType that when set indicates a thread is open. Both of the types may be used interchangeably.

When used with the Thread component this will display the thread. When used with the standard MessageList component this will prevent any singleton components in the OverlayProvider form getting out of sync.

thread should be set on all Channel components when a thread is open.

Type
object

UI Component Props

MessageList

TypeDefault
ComponentTypeMessageList

MessageInput

TypeDefault
ComponentTypeMessageInput
© Getstream.io, Inc. All Rights Reserved.