Skip to main content
Version: v3

MessagesContext

Value

forwarded from Channel props
additionalTouchableProps

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

Type
object

forwarded from Channel props
animatedLongPress

Animate with a pop the long-press action on the message bubble.

TypeDefault
booleaniOS: true
Android: false

forwarded from Channel props
blockUser

Override of the Block User MessageAction shown when a user long presses a message. The blockUser function receives as a parameter the relevant message and must return a MessageAction. Please refer to the guide on customizing message actions for details.

Type
function | null
ParameterDescription
messagemessage the action is called on

channelId

Id of current channel.

Type
string

forwarded from Channel props
copyMessage

Override of the Copy Message MessageAction shown when a user long presses a message. The copyMessage function receives as a parameter the relevant message and must return a MessageAction. Please refer to the guide on customizing message actions for details.

Type
function
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
deleteMessage

Override of the Delete Message MessageAction shown when a user long presses a message. The deleteMessage function receives as a parameter the relevant message and must return a MessageAction. Please refer to the guide on customizing message actions for details.

Type
function | null
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
disableTypingIndicator

Disable typing indicator in MessageList.

TypeDefault
booleanfalse

forwarded from Channel props
dismissKeyboardOnMessageTouch

Dismiss the keyboard when a user touches any of the messages in the list.

TypeDefault
booleanfalse

forwarded from Channel props
editMessage

Override of the Edit Message MessageAction shown when a user long presses a message. The editMessage function receives as a parameter the relevant message and must return a MessageAction. Please refer to the guide on customizing message actions for details.

Type
function | null
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
enableMessageGroupingByUser

Note: This prop is available only in SDK version >= v3.9.0

If false, consecutive messages from same user won't be grouped together.

TypeDefault
booleantrue

forwarded from Channel props
flagMessage

Override of the Flag Message MessageAction shown when a user long presses a message. The flagMessage function receives as a parameter the relevant message and must return a MessageAction. Please refer to the guide on customizing message actions for details.

Type
function | null
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
forceAlignMessages

Forces alignment of messages in the list to either the left or right side of the screen. By default, received messages are aligned on the left side of the screen, and sent messages are aligned on the right.

TypeDefault
'left' | 'right' | falsefalse

forwarded from Channel props
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)

forwarded from Channel props
handleBlock

Function called when the Block User action is invoked from message actions list. This function does not override the default behavior of the Block User action. Please refer to the guide on customizing message actions for details.

Type
function
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
handleCopy

Function called when the Copy Message action is invoked from message actions list. This function does not override the default behavior of the Copy Message action. Please refer to the guide on customizing message actions for details.

Type
function
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
handleDelete

Function called when the Delete Message action is invoked from message actions list. This function does not override the default behavior of the Delete Message action. Please refer to the guide on customizing message actions for details.

Type
function
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
handleEdit

Function called when the Edit Message action is invoked from message actions list. This function does not override the default behavior of the Edit Message action. Please refer to the guide on customizing message actions for details.

Type
function
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
handleFlag

Function called when the Flag Message action is invoked from message actions list. This function does not override the default behavior of the Flag Message action. Please refer to the guide on customizing message actions for details.

Type
function
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
handleMute

Function called when the Mute User action is invoked from message actions list. This function does not override the default behavior of the Mute User action. Please refer to the guide on customizing message actions for details.

Type
function
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
handleQuotedReply

Function called when the Reply action is invoked from message actions list. This function does not override the default behavior of the Reply action. Please refer to the guide on customizing message actions for details.

Type
function
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
handleReaction

Function called when a reaction is selected in the message overlay, this is called on both the add and remove action. This function does not override the default behavior of the reaction being selected. Please refer to the guide on customizing message actions for details.

Type
function
ParameterDescription
messagemessage the action is called on
reactionTypestring designating the type of reaction

forwarded from Channel props
handleRetry

Function called when the Retry action is invoked from message actions list. This function does not override the default behavior of the Retry action. Please refer to the guide on customizing message actions for details.

Type
function
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
handleThreadReply

Function called when the Thread Reply action is invoked from message actions list. This function does not override the default behavior of the Thread Reply action. Please refer to the guide on customizing message actions for details.

Type
function
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
initialScrollToFirstUnreadMessage

Load messages in a channel at the first unread message.

TypeDefault
booleanfalse

forwarded from Channel props
legacyImageViewerSwipeBehaviour

forwarded from Channel props
markdownRules

Object specifying rules defined within simple-markdown.

Type
object

forwarded from Channel props
messageActions

An array of, or function that returns and array of, actions that can be performed on a message shown in the message overlay. Please refer to the guide on customizing message actions for details.

TypeDefault
array | functionmessageActions
ParameterDescription
actionInfoan object containing the original actions and relevant message data

forwarded from Channel props
messageContentOrder

Order in which to render the content of a message.

TypeDefault
array['quoted_reply', 'gallery', 'files', 'text', 'attachments']

forwarded from Channel props
mutesEnabled

Note: This prop is available only in SDK version >= v3.7.0

Allow user to be muted via message action. The default value is supplied by the channel config.

Type
boolean

forwarded from Channel props
muteUser

Override of the Mute User MessageAction shown when a user long presses a message. The muteUser function receives as a parameter the relevant message and must return a MessageAction. Please refer to the guide on customizing message actions for details.

Type
function | null
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
myMessageTheme

Theme applied to messages of the current user.

Type
object

forwarded from Channel props
onDoubleTapMessage

Function called when a user double taps a message.

note

The double tap reaction guide can be used as a reference for implementing other double tap actions.

Type
function
ParameterDescription
payload{ actionHandlers, message }

forwarded from Channel props
onLongPressMessage

Function called when a user long presses a message. The default opens the message actions overlay.

Type
function
ParameterDescription
payload{ actionHandlers, message }

forwarded from Channel props
onPressInMessage

Function called immediately when a touch is engaged on a message, before onPressMessage.

Type
function
ParameterDescription
payload{ actionHandlers, message }

forwarded from Channel props
onPressMessage

Function called when a user presses a message.

caution

The default handler for message press interactions acts differently when pressing on reactions and attachments. You will have to handle these cases when overriding this function.

Type
function
ParameterDescription
payload{ actionHandlers, message }

forwarded from Channel props
quotedRepliesEnabled

Allow messages to be replied to using inline quotation.

TypeDefault
booleantrue

forwarded from Channel props
quotedReply

Override of the Reply MessageAction shown when a user long presses a message. The quotedReply function receives as a parameter the relevant message and must return a MessageAction. Please refer to the guide on customizing message actions for details.

Type
function | null
ParameterDescription
messagemessage the action is called on

forwarded from Channel props
reactionsEnabled

Allow reactions on messages. The default value is supplied by the channel config.

Type
boolean

removeMessage

Function to remove message from local channel state. Please note that this function is only for updating the local state, it doesn't call the API for deleting message (channel.deleteMessage).

Type
(message) => void

forwarded from Channel props
Reply

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

TypeDefault
componentReply

forwarded from Channel props
retry

Override of the Resend Message MessageAction shown when a user long presses a message. The retry function receives as a parameter the relevant message and must return a MessageAction. Please refer to the guide on customizing message actions for details.

Type
function | null
ParameterDescription
messagemessage the action is called on

retrySendMessage

Function to re-attempt sending failed message.

Type
(message) => void

forwarded from Channel props
selectReaction

Full override of the reaction function on a message. This function must return a function that takes as a parameter the reactionType as a string. Please refer to the guide on customizing message actions for details.

Type
function | null
ParameterDescription
messagemessage the action is called on

setEditingState

Enables editing state for given message.

Type
(message) => void

setQuotedMessageState

Enables quoted-reply state on given message.

Type
(message) => void

forwarded from Channel props
supportedReactions

List of reactions which can be added on message. Please refer to the guide on customizing reactions for details.

TypeDefault
arrayreactionData

forwarded from Channel props
threadRepliesEnabled

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

Type
boolean

forwarded from Channel props
threadReply

Override of the Thread Reply MessageAction shown when a user long presses a message. The threadReply function receives as a parameter the relevant message and must return a MessageAction. Please refer to the guide on customizing message actions for details.

Type
function | null
ParameterDescription
messagemessage the action is called on

updateMessage

Upserts a given message in local channel state. Please note that this function doesn't call channel.sendMessage. Channel component uses this function for optimistic updates to message.

Type
(message) => void

forwarded from Channel props
Attachment

Component for rendering attachments in MessageList.

Available props:

  • attachment {object}
TypeDefault
componentAttachment

forwarded from Channel props
AttachmentActions

Component to render additional actions on attachment. for example send, shuffle, cancel in case of Giphy.

TypeDefault
componentAttachmentActions

forwarded from Channel props
Card

Component to render any custom type of attachment. Please check the guides for Custom Attachment

TypeDefault
componentCard

forwarded from Channel props
CardCover

Component to render main body for Card component which renders custom type of attachment. Please check the guides for Custom Attachment.

Type
component

forwarded from Channel props
CardFooter

Component to render footer for Card component which renders custom type of attachment. Please check the guides for Custom Attachment.

Type
component

forwarded from Channel props
CardHeader

Component to render header for Card component which renders custom type of attachment. Please check the guides for Custom Attachment.

Type
component

forwarded from Channel props
DateHeader

Component to render sticky date header within enclosed MessageList component.

TypeDefault
componentDateHeader

forwarded from Channel props
FileAttachment

Component to render 'file' type attachment in MessageList.

TypeDefault
componentFileAttachment

forwarded from Channel props
FileAttachmentGroup

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

TypeDefault
componentFileAttachmentGroup

forwarded from Channel props
FileAttachmentIcon

Component to render file icon for file type attachment.

TypeDefault
componentFileIcon

forwarded from Channel props
FlatList

FlatList component for underlying MessageList component.

TypeDefault
componentflat-list-mvcp

Component to render 'image' type attachments in the MessageList.

TypeDefault
componentGallery

forwarded from Channel props
Giphy

Component to render Giphy type attachments in MessageList.

TypeDefault
componentGiphy

forwarded from Channel props
InlineDateSeparator

Component to render inline date separators between messages which were created at a difference of more than a day.

TypeDefault
componentInlineDateSeparator

forwarded from Channel props
InlineUnreadIndicator

Component to render inline separator in MessageList, to indicate the position of last read message in list.

TypeDefault
componentInlineUnreadIndicator

forwarded from Channel props
MessageAvatar

Component to render avatar of sender for message, within MessageList. This component is only rendered for messages from other users.

TypeDefault
componentMessageAvatar

forwarded from Channel props
MessageContent

Component to render content of message including status, attachments, reactions etc., within MessageList.

TypeDefault
componentMessageContent

forwarded from Channel props
MessageDeleted

Component to render deleted message.

TypeDefault
componentMessageDeleted

forwarded from Channel props
MessageFooter

Component to render footer for message, within MessageList.

TypeDefault
componentMessageFooter

forwarded from Channel props
MessageHeader

Component to render header for message, within MessageList.

Type
component

forwarded from Channel props
MessageReplies

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

TypeDefault
componentMessageReplies

forwarded from Channel props
MessageRepliesAvatars

Component to show avatars of members who thread replied on message.

TypeDefault
componentMessageRepliesAvatars

forwarded from Channel props
MessageSimple

Component to render a message within MessageList.

Please check guides section for Customizing Message UI for details.

TypeDefault
componentMessageSimple

forwarded from Channel props
MessageStatus

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

TypeDefault
componentMessageStatus

forwarded from Channel props
MessageSystem

Component to render system type messages. Purpose of system messages is to inform user about changes to channel. System messages are part of message history, and have a property type set as system. You can add system messages within message history in following scenarios:

TypeDefault
componentMessageSystem

forwarded from Channel props
MessageText

Component to render text of message. By default, we use Simple Markdown package to render the text content of message. If you decide to use this prop, please be aware that you will need to handle the markdown rendering yourself.

TypeDefault
componentrenderText

forwarded from Channel props
OverlayReactionList

Reaction selector component displayed within the message overlay when user long presses a message.

TypeDefault
componentOverlayReactionList

forwarded from Channel props
ReactionList

Component to render list of reactions at top of message bubble.

TypeDefault
componentReactionList

forwarded from Channel props
ScrollToBottomButton

Component to render a button which when pressed, scrolls the message list to bottom.

TypeDefault
componentScrollToBottomButton

forwarded from Channel props
TypingIndicator

Component to render typing indicator within enclosed MessageList component.

TypeDefault
componentTypingIndicator

forwarded from Channel props
TypingIndicatorContainer

Component to render container in which typing indicator gets rendered within enclosed MessageList component.

TypeDefault
componentTypingIndicatorContainer

forwarded from Channel props
UrlPreview

Component to render preview of URLs in MessageList.

TypeDefault
componentCard

Did you find this page helpful?