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

Name Type Required Description
channel Channel Yes Channel used to compute action items.
surface ChannelActionSurface ('list' | 'details') No Identifies which top-level UI is requesting the items. Forwarded to context.surface inside getChannelActionItems. See useChannelActionItems for details.
getChannelActionItems GetChannelActionItems No Optional custom action item transformer.

Returns

Type Description
ChannelActionItemsById Map of action id to channel action config.