useIsDirectChat

Returns true when the channel is a direct chat — i.e. it has exactly 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 vs group) consistency.
  • Avoid inferring 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

NameTypeRequiredDescription
channelChannelNoChannel evaluated as direct vs group.

Returns

TypeDescription
booleanWhether the channel is a direct chat (DM).