---
source_url: https://www.pubnub.com/docs/chat/components/react-native/custom-hooks/use-users
title: useUsers for PubNub Chat Components for React Native
updated_at: 2026-05-22T11:04:08.129Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# useUsers for PubNub Chat Components for React Native

:::warning Migrate to Chat SDK
PubNub will stop supporting Chat Components on January 1, 2025 but you are [welcome to contribute](https://github.com/pubnub/react-chat-components). Learn how to migrate to the Chat SDK [here](https://www.pubnub.com/docs/general/resources/migration-guides/react-components-chat-sdk).
:::

The hook returns a list of User ID metadata objects, optionally including the custom data object for each.

:::note User ID / UUID
User ID is also referred to as **UUID/uuid** in some APIs and server responses but **holds the value** of the **userId** parameter you [set during initialization](https://www.pubnub.com/docs/general/setup/users-and-devices#set-the-user-id).
:::

Pagination is handled internally. You can adjust the `limit` of returned users on a single call (max/default `100`) and call a function returned by the hook to get another page of results. This hook also sets up a listener that reacts to updates and removals of already fetched users.

However, this behavior requires a living subscription to users getting updated - this should be handled by the components.

```tsx
const [users, fetchPage, total, error, isLoading] = useUsers();

return <Chat users={users}>{/* Add components here */}</Chat>;
```

## Input

| Parameter | Defaults | Description |
| --- | --- | --- |
| include | Object | Optional |  | n/a | Option to include respective additional fields in the response. |
| → customFields | Boolean | Optional |  | false | Option to fetch custom fields. |
| filter | String | Optional |  | n/a | Expression used to filter the results. Only objects whose properties satisfy the given expression are returned. See the [App Context Filtering Language Definition](https://www.pubnub.com/docs/general/metadata/filtering) for more details. |
| sort | Object | Optional |  | n/a | Key-value pair of a property to sort by and a sort direction. Available options are `id`, `name`, and `updated`. Use `asc` or `desc` to specify sort direction, or specify `null` to take the default sort direction (ascending). Example: `{name: 'asc'}` |
| limit | Number | Optional |  | `100` | Number of objects to return in response. Default is `100` which is also the maximum value. |

## Output

| Parameter | Description |
| --- | --- |
| `array[0]`Type: User[] | List of returned users. |
| `array[1]`Type: Function | Function that can be called to fetch another page of users. |
| `array[2]`Type: Number | Total number of stored users. |
| `array[3]`Type: Error | If there's an error fetching users, it will be available here. |
| `array[4]`Type: Boolean | Indicator that the users data is still being loaded. |