import { useChannelActionItemsById } from "stream-chat-react-native";
const itemsById = useChannelActionItemsById({ channel });
const muteItem = itemsById.mute;This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8)
.
useChannelActionItemsById
Returns channel action items indexed by their id for fast access.
Best Practices
- Use this hook when action lookup by id is needed in custom UI.
- Keep item ids stable when overriding default channel actions.
- Prefer this hook over array search when repeatedly resolving actions.
- Pass the same
getChannelActionItemscustomization used by your action list. - Handle missing ids defensively in custom components.
Usage
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| channel | Channel | Yes | Channel used to compute action items. |
| getChannelActionItems | GetChannelActionItems | No | Optional custom action item transformer. |
Returns
| Type | Description |
|---|---|
ChannelActionItemsById | Map of action id to channel action config. |