# usePollStateStore

A utility hook used to access the `poll` state store directly by passing a [`selector`](/chat/docs/sdk/react-native/v5/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/v5/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 = <
  StreamChatGenerics extends DefaultStreamChatGenerics =
    DefaultStreamChatGenerics,
>(
  nextValue: PollState<StreamChatGenerics>,
): PollOptionSelectorReturnValue => ({
  latestVotesByOption: nextValue.latestVotesByOption,
  maxVotedOptionIds: nextValue.maxVotedOptionIds,
});

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


---

This page was last updated at 2026-03-04T14:22:10.811Z.

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