import { useIsChannelMuted } from "stream-chat-react-native";
const MutedIndicator = ({ channel }: { channel: Channel }) => {
const { muted } = useIsChannelMuted(channel);
return muted ? <Text>Muted</Text> : null;
};This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8)
.
useIsChannelMuted
Returns the channel mute status and keeps it in sync with client mute events.
Best Practices
- Use this hook instead of manually checking
channel.muteStatus()in render. - Read
mutedfrom the returned object for unread badge and style decisions. - Keep mute indicators subtle and consistent across channel previews.
- Avoid duplicating mute event listeners in custom list components.
- Handle default unmuted state while initial data is syncing.
Usage
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| channel | Channel | Yes | Channel whose mute status is observed. |
Returns
| Name | Type | Description |
|---|---|---|
| muted | boolean | Whether the channel is currently muted. |