# ThreadContext

`ThreadContext` is provided by [`Channel`](/chat/docs/sdk/react-native/v6/core-components/channel/) component. If you are not familiar with React Context API, please read about it on [React docs](https://reactjs.org/docs/context.html).

## Basic Usage

`ThreadContext` can be consumed by any of the child component of `Channel` component as following:

```tsx
import { useContext } from "react";
import { ThreadContext } from "stream-chat-react-native";

const value = useContext(ThreadContext);
```

Alternatively, you can also use `useThreadContext` hook provided by library to consume ThreadContext.

```tsx
import { useThreadContext } from "stream-chat-react-native";

const value = useThreadContext();
```

## Value

### allowThreadMessagesInChannel ``

Display the _Show thread message in channel_ button inside the thread MessageInput.

| Type    | Default |
| ------- | ------- |
| boolean | true    |


### `closeThread`

Unsets the thread and thread messages in the Channel state.

| Type     |
| -------- |
| Function |


### loadMoreThread

Loads more messages for the thread. Returns a promise.

| Type                  |
| --------------------- |
| `() => Promise<void>` |


### `openThread`

Sets the thread and thread messages in the Channel state.

| Type     |
| -------- |
| function |


### `parentMessagePreventPress`

Boolean to enable/disable parent message press.

| Type    | Default |
| ------- | ------- |
| Boolean | `true`  |


### `reloadThread`

Reloads the thread and thread messages.

| Type     |
| -------- |
| function |


### setThreadLoadingMore

A function which can be used to set the thread loading more state.

| Type     |
| -------- |
| function |


### thread

Can be either a `MessageType` object or a [`ThreadType`](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/contexts/threadContext/ThreadContext.tsx) that when set indicates a thread is open.
Both of the types may be used interchangeably.

When used with the [`Thread`](/chat/docs/sdk/react-native/v6/ui-components/thread/) component this will display the thread.
When used with the standard [`MessageList`](/chat/docs/sdk/react-native/v6/ui-components/message-list/) component this will prevent any singleton components in the [`OverlayProvider`](/chat/docs/sdk/react-native/v6/core-components/overlay-provider/) form getting out of sync.

<admonition type="note">

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

</admonition>

| Type   |
| ------ |
| object |


### threadHasMore

Boolean flag for thread messages pagination.

| Type    |
| ------- |
| boolean |


### threadLoadingMore

Boolean flag for thread messages loading more state.

| Type    |
| ------- |
| boolean |


### `threadMessages`

A list of formatted messages objects.

| Type            |
| --------------- | --- |
| `Array<object>` |     |



---

This page was last updated at 2026-05-13T13:38:47.675Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react-native/v6/contexts/thread-context/](https://getstream.io/chat/docs/sdk/react-native/v6/contexts/thread-context/).