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

MessageContent

Component to render content of a message within the MessageList. Message avatar and reactions are not part of MessageContent. This is the default component provided to the prop MessageContent on the Channel component.

Props

additionalTouchableProps

Additional props provided to the underlying TouchableOpacity used by components within a message such as MessageContent.

Type
object

alignment

Sets if the message should be aligned to right or left side of list.

TypeDefault
enum(‘right’, ‘left’)‘right’

disabled

True if channel is frozen and disableIfFrozenChannel is true.

Type
Boolean

formatDate

Format function that returns a string to be used for the date in the message status and delete message component.

Type
function
ParameterDescription
datedate to format provided as a string, Date, or number (Unix Timestamp)

groupStyles

Position of message in the group. A message group is a group of consecutive messages from the same user. groupStyles can be used to style the message as per their position in message group.

For example, user avatar (to which message belongs to) is only showed for last (bottom) message in group.

Type
array of enum(‘top’, ‘bottom’, ‘middle’, ‘single’)

hasReactions

True if the message has at least 1 reaction.

Type
boolean

isMyMessage

True if the message is sent by current user (connected to chat).

Type
boolean

lastGroupMessage

Whether or not this is the last message in a group of messages.

Type
boolean

members

Members of current channel. This value is received from backend when you query a channel, either using client.queryChannels() or channel.watch() API call.

client.queryChannels() or channel.watch() returns only up to 100 members of channel. So if you expect total number of members to be > 100, its better to use client.queryMembers() API endpoint separately to get the list of members.

Record<
  string, // userId
  {
    banned?: boolean;
    created_at?: string;
    invite_accepted_at?: string;
    invite_rejected_at?: string;
    invited?: boolean;
    is_moderator?: boolean;
    role?: string;
    shadow_banned?: boolean;
    updated_at?: string;
    user?: UserResponse<UserType>;
    user_id?: string;
  }
>;
Type
object

message

Message object.

Type
Message type

messageContentOrder

Order of message content.

for example ['quoted_reply', 'attachments', 'file', 'gallery', 'text']

Type
array

onLongPress

Default long press handler for message UI.

Type
function

onlyEmojis

True if the message text only contains emojis and nothing else.

Type
Boolean

onPress

Default press handler for message UI.

Type
function

onPressIn

Default pressIn handler for message UI.

Type
function

otherAttachments

All the attachments on the message except for types file and image.

Type
Array

showMessageStatus

When false, message status (read receipt, pending state indicator) won’t be rendered. By default, this value is true for messages sent by current user of chat.

Type
boolean

threadList

True if current message is part of a message thread.

Type
Boolean

UI Component Props

Attachment

Component for rendering attachments in MessageList.

Available props:

  • attachment {object}
TypeDefault
ComponentTypeAttachment

FileAttachmentGroup

Component to render group of file type attachments, when there are multiple file type attachments in message.

TypeDefault
ComponentTypeFileAttachmentGroup

Component to render ‘image’ type attachments in the MessageList.

TypeDefault
ComponentTypeGallery

MessageDeleted

Component to render deleted message.

TypeDefault
ComponentTypeMessageDeleted

MessageError

Component to customize the message error component.

TypeDefault
ComponentTypeMessageError

MessageFooter

Component to render footer for message, within MessageList.

TypeDefault
ComponentTypeMessageFooter

MessageHeader

Component to render header for message, within MessageList.

Type
ComponentType

MessageReplies

Component to show number of thread replies and avatars of members who replied on message

TypeDefault
ComponentTypeMessageReplies

MessageStatus

Component to render status of message, which includes time and read-receipts.

TypeDefault
ComponentTypeMessageStatus

Reply

Component to render preview of parent of message for quoted reply.

TypeDefault
ComponentTypeReply

© Getstream.io, Inc. All Rights Reserved.