This is documentation for Stream Chat React Native SDK v4, which is nolonger actively maintained. For up-to-date documentation, see the latest version (v6).

ChannelAvatar

Component to render the avatar of a channel, within the ChannelList component.

Basic Usage

You can customize this component and provide it back to the SDK via the PreviewAvatar prop on ChannelList if desired.

In the following sample we add an onPress handler on avatar.

import { TouchableOpacity } from "react-native-gesture-handler";
import { ChannelList, ChannelAvatar } from "stream-chat-react-native";

<ChannelList
  PreviewAvatar={({ channel }) => (
    <TouchableOpacity
      disallowInterruption={true}
      onPress={() => {
        /** Handler for press action */
      }}
    >
      <ChannelAvatar channel={channel} />
    </TouchableOpacity>
  )}
/>;

Props

channel

Instance of Channel from stream-chat package.

© Getstream.io, Inc. All Rights Reserved.