# ChatContext

> **Info:** This is documentation for **Stream Chat React Native SDK v6**, which is no longer actively maintained. For up-to-date documentation, see the [latest version (v10)](https://getstream.io/chat/docs/sdk/react-native/).

`ChatContext` is provided by [`Chat`](https://getstream.io/chat/docs/sdk/react-native/v6/core-components/chat/) 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

`ChatContext` can be consumed by any of the child component of `Chat` component as following:

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

const { client, isOnline } = useContext(ChatContext);
```

Alternatively, you can also use `useChatContext` hook provided by library to consume ChatContext.

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

const { client, isOnline } = useChatContext();
```

## Value

### client

Instance of StreamChat client.

| Type                                                        |
| ----------------------------------------------------------- |
| [`StreamChat`](https://github.com/GetStream/stream-chat-js) |

### `connectionRecovering`

The value is true, when connection to WebSocket server is disconnected and is currently being recovered.

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

### isOnline

The value is true, when current user is connected to chat.

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

### ImageComponent

Drop in replacement of all the underlying [`Image`](https://reactnative.dev/docs/next/image) components within SDK.
This is useful for the purpose of offline caching of images. Please check the [Offline Support Guide](https://getstream.io/chat/docs/sdk/react-native/v6/basics/offline-support/) for usage.

| Type          | Default                                            |
| ------------- | -------------------------------------------------- |
| ComponentType | [`Image`](https://reactnative.dev/docs/next/image) |

### `mutedUsers`

Array of users muted by current user.

| Type  |
| ----- |
| array |

---

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