import { useChannelActionItems } from "stream-chat-react-native";
const actionItems = useChannelActionItems({
channel,
getChannelActionItems: ({ defaultItems }) =>
defaultItems.filter((item) => item.id !== "archive"),
});This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8)
.
useChannelActionItems
Builds channel action items (mute, archive, leave, delete, etc.) for swipe rows and action sheets.
Best Practices
- Use this hook as the source of truth for channel row actions.
- Prefer
getChannelActionItemsto customize ordering/visibility instead of rebuilding defaults. - Keep custom action handlers async-safe and user-feedback friendly.
- Distinguish direct chats vs group channels when customizing labels.
- Keep destructive actions clearly separated from standard actions.
Usage
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| channel | Channel | Yes | Channel used to compute available actions. |
| getChannelActionItems | GetChannelActionItems | No | Optional transformer for default action items. |
Returns
| Type | Description |
|---|---|
ChannelActionItem[] | Ordered action definitions for channel UI controls. |