This is documentation for Stream Chat React-native SDK v3, which is no longer actively maintained. For up-to-date documentation, see the latest version (v5).

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
object

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

quotedRepliesEnabled

Allow messages to be replied to using inline quotation.

TypeDefault
booleantrue

threadList

True if current message is part of a message thread.

Type
boolean

threadRepliesEnabled

Allow messages to be replied to in a thread. The default value is supplied by the channel config.

Type
boolean

Attachment

Component for rendering attachments in MessageList.

Available props:

  • attachment {object}
TypeDefault
componentAttachment

FileAttachmentGroup

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

TypeDefault
componentFileAttachmentGroup

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

TypeDefault
componentGallery

MessageDeleted

Component to render deleted message.

TypeDefault
componentMessageDeleted

MessageFooter

Component to render footer for message, within MessageList.

TypeDefault
componentMessageFooter

MessageHeader

Component to render header for message, within MessageList.

Type
component

MessageReplies

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

TypeDefault
componentMessageReplies

MessageStatus

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

TypeDefault
componentMessageStatus

Reply

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

TypeDefault
componentReply

© Getstream.io, Inc. All Rights Reserved.