useChannelImage

Reads channel.data?.image reactively and re-renders when the channel is updated.

Best Practices

  • Use this hook to drive the channel avatar/image in headers, previews, and details screens.
  • Treat the value as read-only state derived from the channel store.
  • Handle undefined and provide a fallback avatar (e.g. member images or initials).
  • Prefer this hook over reading channel.data?.image directly so the UI stays in sync with channel.updated events.

Usage

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

const image = useChannelImage(channel);

Parameters

NameTypeRequiredDescription
channelChannelNoChannel whose image is read.

Returns

TypeDescription
string | undefinedThe channel's image URL, or undefined if not set.