useMutedUsers

Tracks the list of users muted by the current user. It initialises the list from the client and keeps it up to date by listening to notification.mutes_updated events.

Best Practices

  • Access the mutedUsers list through useChatContext instead.
  • Treat the returned list as read-only; use the client methods muteUser and unmuteUser to modify mutes.
  • Handle an empty muted users array gracefully.

Usage

useMutedUsers.ts
import { useMutedUsers } from "stream-chat-react-native";

const mutedUsers = useMutedUsers(client);

const isUserMuted = mutedUsers.some((mute) => mute.target.id === userId);

This hook is used internally by the Chat component. The mutedUsers list is available through the ChatContext via the mutedUsers property.

Parameters

NameTypeRequiredDescription
clientStreamChatYesThe Stream Chat client instance.

Returns

TypeDescription
Mute[]An array of mute objects for the current user's muted users.