# usePollAnswersPagination

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

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](https://getstream.io/chat/docs/sdk/react-native/v7/ui-components/poll-answers-list/) for example.

## 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[]` |

---

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