This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8) .

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

NameTypeRequiredDescription
channelChannelYesChannel evaluated as direct vs group.

Returns

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