useChannelOnlineMemberCount

Returns the number of online members in a channel.

Best Practices

  • Use this hook for lightweight presence summaries in list rows.
  • Keep online count formatting concise for compact channel previews.
  • Handle optional returns when channel is not yet available.
  • Avoid recomputing member online counts manually in render.
  • Pair this hook with member-state hooks only when additional details are needed.

Usage

import { useChannelOnlineMemberCount } from "stream-chat-react-native";

const onlineCount = useChannelOnlineMemberCount(channel) ?? 0;

Parameters

Name Type Required Description
channel Channel No Channel used to compute online count.

Returns

Type Description
number | undefined Number of online members.
Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat React Native v9: <Your Question>