# PollContext

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

`PollContext` must be used within [`Channel`](/chat/docs/sdk/react-native/v8/core-components/channel/) because it depends on values provided there.

## Best Practices

- Use `usePollContext` inside `Channel`-scoped poll components only.
- Treat `poll` and `message` as read-only UI state.
- Avoid duplicating poll state in local component state.
- Handle missing or stale poll data gracefully.
- Keep poll UI logic lightweight to avoid list re-renders.

## Basic Usage

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

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

const value = useContext(PollContext);
```

Alternatively, use the `usePollContext` hook.

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

const value = usePollContext();
```

## Value

### message

Message object.

| Type           |
| -------------- |
| `Message` type |


### `poll` \*

An instance of the [`Poll` class](https://github.com/GetStream/stream-chat-js/blob/master/src/poll.ts) containing reactive state.

It is used by the underlying `usePollContext`, `usePollStateStore` and `usePollState` hooks to provide us with the reactive `Poll` state.

<admonition type="note">

If you need the `Poll` instance you may get it from `client.polls.fromState(pollId)`.

</admonition>

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



---

This page was last updated at 2026-04-17T17:33:45.040Z.

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