# usePollStateStore

A utility hook used to access the `poll` state store directly by passing a [`selector`](/chat/docs/sdk/react-native/state-and-offline-support/state-overview#what-are-selectors/).

The full extent of the `Poll` state can be found [here](https://github.com/GetStream/stream-chat-js/blob/master/src/poll.ts), under the `PollState` type.

This hook can only be used within a child of [`PollContext`](/chat/docs/sdk/react-native/contexts/poll-context/).

## Example usage

```tsx
import { PollVote, PollState } from "stream-chat";
import { usePollStateStore } from "stream-chat-react-native";

type PollOptionSelectorReturnValue = {
  latestVotesByOption: Record<string, PollVote[]>;
  maxVotedOptionIds: string[];
};

const selector = (nextValue: PollState): PollOptionSelectorReturnValue => ({
  latestVotesByOption: nextValue.latestVotesByOption,
  maxVotedOptionIds: nextValue.maxVotedOptionIds,
});

const { latestVotesByOption, maxVotedOptionIds } = usePollStateStore(selector);
```

---

This page was last updated at 2025-08-15T14:16:31.122Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react-native/hooks/poll/use-poll-state-store/](https://getstream.io/chat/docs/sdk/react-native/hooks/poll/use-poll-state-store/).