# ThreadContext

`ThreadContext` is provided by [`Channel`](https://getstream.io/chat/docs/sdk/react-native/v4/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 |

### `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

A message object that when set indicates a thread is open.
When used with the [`Thread`](https://getstream.io/chat/docs/sdk/react-native/v4/ui-components/thread/) component this will display the thread.
When used with the standard [`MessageList`](https://getstream.io/chat/docs/sdk/react-native/v4/ui-components/message-list/) component this will prevent any singleton components in the [`OverlayProvider`](https://getstream.io/chat/docs/sdk/react-native/v4/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-09-08T08:33:03.574Z.

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