usePolls()
usePolls
usePolls
The usePolls
hook is a custom hook provided by the pollz-react
package. It allows you to fetch a paginated list of all polls from the Pollz SDK within a React component.
Parameters
The usePolls
hook does not take any parameters.
Return Values
The usePolls
hook returns an object with the following properties:
polls
({ items: Poll[]; meta: PaginationMeta }): An object containing the list of polls (items
) and metadata (meta
) about the retrieved polls, including total count, current page, items per page, and total number of pages.refetch
(function): A function to manually refetch the list of polls.
Usage
The usePolls
hook simplifies the process of fetching and displaying a paginated list of all polls within your React components. Customize the hook based on your application's needs.
Last updated