This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8) .

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

NameTypeRequiredDescription
pollIdstringYesIdentifier of the poll to read.

Returns

TypeDescription
string | undefinedLocalized label such as You voted: Option A when data exists.