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

additionalPressableProps

Additional props provided to the underlying Pressable 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’

backgroundColor

Background color for the message content.

Type
string | undefined

disabled

True if channel is frozen and disableIfFrozenChannel is true.

Type
Boolean

goToMessage

A function that scrolls to a specific message in the chat. This function is useful when you want to scroll to a specific message in the chat.

TypeDefault
(messageId: string) => void| undefinedundefined

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’)

isAttachmentEqual

Function which returns true if passing nextAttachment to render would return the same result as passing prevAttachment to render, otherwise return false.

Type
function
ParameterDescription
prevAttachmentprevious message attachment to be compared
nextAttachmentnext message attachment to be compared

isEditedMessageOpen

Boolean to check the message edited label is expanded or not.

TypeDefault
Booleanfalse

isMyMessage

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

Type
boolean

message

Message object.

Type
Message type

messageContentOrder

Order of message content.

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

Type
array

MyMessageTheme

Theme applied to messages of the current user.

Type
object

Please make sure to memoize or pass static reference for this object.

noBorder

If true, the message content will not have a border.

TypeDefault
Boolean| undefinedfalse

onLongPress

Default long press handler for message UI.

Type
function

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

preventPress

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

MessageError

Component to customize the message error component.

TypeDefault
ComponentTypeMessageError

Reply

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

TypeDefault
ComponentTypeReply

© Getstream.io, Inc. All Rights Reserved.