# useChannelMemberCount

Reads `channel.data?.member_count` reactively (defaulting to `0`) and re-renders when the channel is updated.

## Best Practices

- Use this hook to display member counts in channel headers and details screens.
- Treat the value as read-only state derived from the channel store.
- The hook defaults to `0` when no count is available, so you rarely need to guard for `undefined` when a channel is provided.
- Prefer this hook over reading `channel.data?.member_count` directly so the UI stays in sync with `channel.updated` events.

## Usage

```tsx
import { useChannelMemberCount } from "stream-chat-react-native";

const memberCount = useChannelMemberCount(channel);
```

## Parameters

| Name    | Type      | Required | Description                         |
| ------- | --------- | -------- | ----------------------------------- |
| channel | `Channel` | No       | Channel whose member count is read. |

## Returns

| Type                    | Description                                                                |
| ----------------------- | -------------------------------------------------------------------------- |
| `number` \| `undefined` | The channel's member count (`0` when unset), or `undefined` if no channel. |


---

This page was last updated at 2026-06-30T12:00:28.139Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react-native/hooks/channel-state/use-channel-member-count/](https://getstream.io/chat/docs/sdk/react-native/hooks/channel-state/use-channel-member-count/).