Info:
This is documentation for Stream Chat React Native SDK v8, which is no longer actively maintained. For up-to-date documentation, see the latest version (v9).

ChannelPreviewMessenger

Renders a channel list item inside ChannelList. This is the default component for the Preview prop.

Best Practices

  • Keep the preview row simple to maintain smooth list scrolling.
  • Clamp unread counts with maxUnreadCount to avoid layout overflow.
  • Use formatLatestMessageDate to keep date formatting consistent with your app.
  • Memoize onSelect handlers to reduce re-renders.
  • Override subcomponents (PreviewAvatar, PreviewMessage, etc.) for consistent branding.

Props

channel

Channel instance from the Stream Chat client.

Type
Channel

formatLatestMessageDate

Formatter for the latest message date.

Returns a formatted date string. Default: today uses HH:mm A, other dates use DD/MM/YY (see ChannelPreview).

Type
(date: Date) => string

latestMessagePreview

Latest message formatted for preview.

Example:

{
 created_at: '' ,
 messageObject: { ... },
 previews: {
   bold: true,
   text: 'This is the message preview text'
 },
 status: 0 | 1 | 2 // read states of latest message.
}
Type
Object

maxUnreadCount

Max number shown in the unread badge. The value cannot exceed the backend limit of 255.

Type Default
number 255

onSelect

Function called when a user presses an item in the ChannelList. The function is called with the Channel instance corresponding to the list item as the only parameter. This callback is often used for navigating to a channel screen.

Example

onSelect={(channel) => { /** navigation logic */ }}
Note:

A Channel instance is not serializable and will therefore raise warnings if passed as a parameter through navigation to another screen.

Type
function
Parameter Description
channel Channel instance

unread

Number of unread messages in the channel.

Type
number

UI Component Props

PreviewAvatar

Avatar component rendered within Preview.

Type Default
ComponentType ChannelAvatar

PreviewMessage

Message component rendered within Preview.

Type Default
ComponentType ChannelPreviewMessage

PreviewStatus

Status component rendered within Preview.

Type Default
ComponentType ChannelPreviewStatus

PreviewTitle

Title component rendered within Preview.

Type Default
ComponentType ChannelPreviewTitle

PreviewUnreadCount

Unread count component rendered within Preview.

Type Default
ComponentType ChannelPreviewUnreadCount
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 v8: <Your Question>