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.
Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat React Native v9: <Your Question>