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 getChannelActionItems customization used by your action list.
  • Handle missing ids defensively in custom components.

Usage

import { useChannelActionItemsById } from "stream-chat-react-native";

const itemsById = useChannelActionItemsById({ channel });
const muteItem = itemsById.mute;

Parameters

NameTypeRequiredDescription
channelChannelYesChannel used to compute action items.
getChannelActionItemsGetChannelActionItemsNoOptional custom action item transformer.

Returns

TypeDescription
ChannelActionItemsByIdMap of action id to channel action config.