# KeyboardContext

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

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

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

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

const { dismissKeyboard } = useContext(KeyboardContext);
```

Alternatively, you can also use `useKeyboardContext` hook provided by library to consume KeyboardContext.

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

const { dismissKeyboard } = useKeyboardContext();
```

## Value

### `dismissKeyboard`

Function to dismiss the keyboard.

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

---

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