useIsDirectChat

Returns true when the channel is a direct chat (one other member besides the current user).

Best Practices

  • Use this hook to branch UI for DM vs group behaviors.
  • Keep DM-specific logic centralized instead of scattering member checks.
  • Rely on this hook for action labeling (chat/group) consistency.
  • Avoid assuming channel type from channel.type alone.
  • Treat the result as derived state and avoid local duplication.

Usage

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

const isDirectChat = useIsDirectChat(channel);

Parameters

Name Type Required Description
channel Channel Yes Channel evaluated as direct vs group.

Returns

Type Description
boolean Whether the channel is a direct chat (DM).
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>