# ThreadContext

`ThreadContext` is provided by [`Channel`](/chat/docs/sdk/react-native/v8/core-components/channel/). If you are not familiar with the React Context API, see the [React docs](https://reactjs.org/docs/context.html).

## Best Practices

- Use `useThreadContext` for consistent access and typings.
- Manage thread navigation via `openThread`/`closeThread` rather than manual state.
- Use `threadHasMore` and `threadLoadingMore` to control pagination.
- Keep thread UI logic separate from channel message lists.
- Avoid heavy computations in thread context consumers.

## Basic Usage

Consume `ThreadContext` in any child of `Channel`:

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

const value = useContext(ThreadContext);
```

Alternatively, use the `useThreadContext` hook.

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

const value = useThreadContext();
```

## Value

### allowThreadMessagesInChannel

Show the _Show thread message in channel_ button in 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 a `LocalMessage` or [`ThreadType`](https://github.com/GetStream/stream-chat-react-native/v8/blob/develop/package/src/contexts/threadContext/ThreadContext.tsx). Setting it indicates a thread is open. Both types are interchangeable.

With [`Thread`](/chat/docs/sdk/react-native/v8/ui-components/thread/), this displays the thread. With the standard [`MessageList`](/chat/docs/sdk/react-native/v8/ui-components/message-list/), it keeps singleton components in [`OverlayProvider`](/chat/docs/sdk/react-native/v8/core-components/overlay-provider/) in sync.

<admonition type="note">

Set `thread` 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-04-17T17:33:44.986Z.

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