useChannelPreviewPollLabel

Builds a localized poll activity label for channel preview rows.

Best Practices

  • Use this hook only when poll previews are shown in channel list items.
  • Pass a stable pollId value to avoid unnecessary recomputation.
  • Handle empty return values when no votes are available yet.
  • Rely on built-in translation output for user-facing copy consistency.
  • Keep poll metadata rendering minimal in list UI.

Usage

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

const PollPreviewLabel = ({ pollId }: { pollId: string }) => {
  const label = useChannelPreviewPollLabel({ pollId });
  return label ? <Text>{label}</Text> : null;
};

Parameters

Name Type Required Description
pollId string Yes Identifier of the poll to read.

Returns

Type Description
string | undefined Localized label such as You voted: Option A when data exists.
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>