> For the complete documentation index, see [llms.txt](https://pollz.gitbook.io/pollz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pollz.gitbook.io/pollz/tooling/react/usepolltypes.md).

# usePollTypes()

## `usePollTypes`&#x20;

The `usePollTypes` hook is a custom hook provided by the `pollz-react` package. It allows you to fetch and manage the list of available poll types from the Pollz SDK within a React component.

### Parameters

The `usePollTypes` hook does not take any parameters.

### Return Values

The `usePollTypes` hook returns an object with the following properties:

* `pollTypes` (PollType\[] | null): An array containing the list of available poll types. `null` if the poll types are still loading.
* `refetch` (function): A function to manually refetch the list of poll types.

### Usage

```jsx
import { usePollTypes } from 'pollz-react';

const YourComponent = () => {
  const { pollTypes, refetch } = usePollTypes();

  if (!pollTypes) {
    return <div>Loading...</div>;
  }

  return (
    <div>
      <h2>Poll Types</h2>
      {pollTypes.map((pollType) => (
        <div key={pollType.id}>
          <p>{pollType.name}</p>
          {/* Render additional poll type details */}
        </div>
      ))}
      <button onClick={() => refetch()}>Refetch Poll Types</button>
    </div>
  );
};
```
