import { useIsDirectChat } from "stream-chat-react-native";
const isDirectChat = useIsDirectChat(channel);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.typealone. - Treat the result as derived state and avoid local duplication.
Usage
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). |