import { useChannelActions } from "stream-chat-react-native";
const actions = useChannelActions(channel);
await actions.muteChannel();
await actions.archive();This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8)
.
useChannelActions
Creates imperative channel action handlers such as pin, archive, leave, and mute.
Best Practices
- Use these handlers directly in row actions and action sheets.
- Guard UI against repeated taps while async actions are pending.
- Use direct-chat specific actions (
muteUser,blockUser) only when applicable. - Keep channel lifecycle actions (
leave,deleteChannel) behind confirmation UI. - Handle optimistic UI updates separately from these network calls.
Usage
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| channel | Channel | Yes | Channel to perform actions on. |
Returns
| Type | Description |
|---|---|
ChannelActions | Action handlers for pin/archive/mute/block flows. |