# usePollAnswersPagination

A hook that queries answers for a given `Poll` and returns them in a paginated fashion. It can be used whenever we want to view all answers in a given `poll`, like in the [`PollAnswersList` component](/chat/docs/sdk/react-native/ui-components/poll-answers-list/) for example.

## Best Practices

- Use pagination to avoid loading large answer sets at once.
- Check `hasNextPage` before calling `loadMore`.
- Use `loading` to prevent duplicate pagination calls.
- Keep `paginationParams` stable to avoid refetch loops.
- Handle errors and empty states gracefully in your UI.

## Properties

### `loadFirstPage`

A property that depicts whether the hook should load the first page of answers when first invoked or not. Default to `true` if omitted.

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

### `paginationParams`

An object containing the pagination parameters that we may want to pass to the hook that will then be used to query for answers.

Its type can be found [here](https://github.com/GetStream/stream-chat-js/blob/master/src/types.ts) under the name `PollAnswersQueryParams`.

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

## Return type

The `usePollAnswersPagination` hook returns an object containing pagination values for the `poll`'s answers.

### error

An object containing an error if one is thrown during querying for the answers.

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

### hasNextPage

A property depicting whether the list of answers has a next page to load or not.

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

### loading

A property depicting whether the next page of answers is currently loading or not.

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

### loadMore

A function that loads the next page of answers whenever invoked. It will automatically update [`pollAnswers`](#pollanswers)

| Type         |
| ------------ |
| `() => void` |

### next

A reference to the next cursor in the pagination.

| Type     |
| -------- |
| `string` |

### pollAnswers

A list of answers that has been loaded so far. It automatically updates itself whenever `loadMore()` is invoked and triggers a `state` update.

| Type           |
| -------------- |
| `PollAnswer[]` |


---

This page was last updated at 2026-03-06T17:06:10.055Z.

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