---
source_url: https://www.pubnub.com/docs/chat/components/react-native/custom-hooks/use-user-memberships
title: useUserMemberships for PubNub Chat Components for React Native
description: Learn how to manage user channel memberships in React Native apps using the useUserMemberships hook from PubNub.
updated_at: 2026-09-30T07:20:08.000Z
---

# useUserMemberships for PubNub Chat Components for React Native

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

USED BY THE OLD IA, PLEASE DISREGARD

The hook returns a list of channel memberships for a user.

This method doesn't return user's subscriptions. Pagination is handled internally. You can adjust the `limit` of returned channels 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 removals of already fetched channels. Updates and new memberships are not handled due to technical limitations. However, this behavior requires a living subscription to the user getting updated - this should be handled by the components.

:::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/architecture/core-concepts.md).
:::

```tsx
const [channels, fetchPage, refetchMemberships, total, error, isLoading] = useUserMemberships({
  uuid: "user",
});

return (
  <Chat {...{ options }}>
    <ChannelList channels={channels} />
  </Chat>
);
```

## Input

| Parameter | Type | Required | Description | Defaults |
| --- | --- | --- | --- | --- |
| include | Object | Optional | Option to include respective additional fields in the response. | n/a |
| → customFields | Boolean | Optional | Option to fetch `custom` fields or not. | `false` |
| → channelFields | Boolean | Optional | Option to include fields for channels metadata. | `false` |
| → customChannelFields | Boolean | Optional | Option to include custom fields for channels metadata. | `false` |
| filter | String | Optional | 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/data-storage/metadata/filtering.md) for more details. | n/a |
| sort | Object | Optional | 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'}` | n/a |
| limit | Number | Optional | Number of objects to return in response. Default is `100` which is also the maximum value. | `100` |

## Output

| Parameter | Type | Description |
| --- | --- | --- |
| array[0] | ChannelData[] | List of returned channels. |
| array[1] | Function | Function that can be called to fetch another page of channels. |
| array[2] | Function | Function that can be called to completely reset the hook. This can be used in case of expected membership updates. |
| array[3] | Number | Total number of stored channels. |
| array[4] | Error | If there's an error fetching channels, it will be available here. |
| array[5] | Boolean | Indicator that the user membership data is still being loaded. |

Last updated at: 2026-09-30T07:20:08.000Z
