• The highest level of these components is the OverlayProvider. The OverlayProvider allows users to interact with messages on long press above the underlying views, use the full screen image viewer, and use the AttachmentPicker as a keyboard-esk view. Because these views must exist above all others OverlayProvider should wrap your navigation stack as well. Assuming React Navigation is being used, your highest level navigation stack should be wrapped in the provider:

    <NavigationContainer>
      <OverlayProvider>
        <Stack.Navigator>
          <Stack.Screen />
        </Stack.Navigator>
      </OverlayProvider>
    </NavigationContainer>
  • Don't forget to check our cookbook section of OverlayProvider

  • Also check the visual component guide, to learn about component customizations.

AttachmentPickerBottomSheetHandle

Custom UI component to render draggable handle of attachment picker.

Default AttachmentPickerBottomSheetHandle

TypeRequired
Component, elementNo

AttachmentPickerError

Custom UI component to render error component while opening attachment picker.

Default AttachmentPickerError

TypeRequired
Component, elementNo

AttachmentPickerErrorImage

Custom UI component to render error image for attachment picker

Default AttachmentPickerErrorImage

TypeRequired
Component, elementNo

ImageOverlaySelectedComponent

Custom UI component to render overlay component, that shows up on top of selected image (with tick mark)

Default ImageOverlaySelectedComponent

TypeRequired
Component, elementNo

attachmentPickerErrorText

TypeRequired
stringNo

attachmentSelectionBarHeight

TypeRequired
numberNo

bottomInset

bottomInset determine the height of the AttachmentPicker and the underlying shift to the MessageList when it is opened. This can also be set via the setBottomInset function provided by the useAttachmentPickerContext hook.

Please check OverlayProvider section in Cookbook for more details.

TypeRequired
numberNo

CameraSelectorIcon

Custom UI component for camera selector icon

Default: CameraSelectorIcon

TypeRequired
Component, elementNo

FileSelectorIcon

Custom UI component for file selector icon

Default: FileSelectorIcon

TypeRequired
Component, elementNo

ImageSelectorIcon

Custom UI component for image selector icon

Default: ImageSelectorIcon

TypeRequired
Component, elementNo

topInset

topInset must be set to ensure that when the picker is completely open it is opened to the desired height. This can be done via props, but can also be set via the setTopInset function provided by the useAttachmentPickerContext hook. The bottom sheet will not render without this height set, but it can be set to 0 to cover the entire screen, or the safe area top inset if desired.

Please check OverlayProvider section in Cookbook for more details.

TypeRequired
numberNo

imageGalleryCustomComponents

Override props for following UI components, which are part of image gallery.

e.g.,

{
 footer: {
   ShareIcon: CustomShareIconComponent
 },
 grid: {
   avatarComponent: CustomAvatarComponent
 },
 gridHandle: {
   centerComponent: CustomCenterComponent
 },
 header: {
   CloseIcon: CustomCloseButtonComponent
 },
}
TypeRequired
objectNo

MessageActions

Custom UI component for rendering message actions in overlay.

Default MessageActions

TypeRequired
Component, elementNo

OverlayReactionList

Custom UI component for rendering reaction selector in overlay (which shows up on long press on message).

Default OverlayReactionList

TypeRequired
Component, elementNo

OverlayReactions

Custom UI component for rendering reactions list, in overlay (which shows up on long press on message).

Default OverlayReactions

TypeRequired
Component, elementNo

closePicker

TypeRequired
((ref: RefObject<BottomSheetMethods>) => void)No

imageGalleryGridHandleHeight

TypeRequired
numberNo

imageGalleryGridSnapPoints

TypeRequired
[ReactText, ReactText]No

openPicker

TypeRequired
((ref: RefObject<BottomSheetMethods>) => void)No

value

TypeRequired
Partial<OverlayContextValue>No

Chat - Wrapper component for Chat. The needs to be placed around any other chat components. This Chat component provides the ChatContext to all other components.

The ChatContext provides the following props:

  • channel - currently active channel
  • client - client connection
  • connectionRecovering - whether or not websocket is reconnecting
  • isOnline - whether or not set user is active
  • setActiveChannel - function to set the currently active channel

The Chat Component takes the following generics in order:

  • At (AttachmentType) - custom Attachment object extension
  • Ct (ChannelType) - custom Channel object extension
  • Co (CommandType) - custom Command string union extension
  • Ev (EventType) - custom Event object extension
  • Me (MessageType) - custom Message object extension
  • Re (ReactionType) - custom Reaction object extension
  • Us (UserType) - custom User object extension

client

The StreamChat client object

import { StreamChat } from 'stream-chat';
import { Chat } from 'stream-chat-react-native';

const client = StreamChat.getInstance('api_key);
await client.connectUser('user_id', 'userToken');

<Chat client={client}>
</Chat>
TypeRequired
StreamChatNo

closeConnectionOnBackground

When false, ws connection won't be disconnection upon backgrounding the app. To receive push notifications, its necessary that user doesn't have active websocket connection. So by default, we disconnect websocket connection when app goes to background, and reconnect when app comes to foreground.

TypeRequired
booleanNo

i18nInstance

Instance of Streami18n class should be provided to Chat component to enable internationalization.

Stream provides following list of in-built translations: 1. English (en) 2. Dutch (nl) 3. ... 4. ...

Simplest way to start using chat components in one of the in-built languages would be following:

const i18n = new Streami18n('nl');
<Chat client={chatClient} i18nInstance={i18n}>
 ...
</Chat>

If you would like to override certain keys in in-built translation. UI will be automatically updated in this case.

const i18n = new Streami18n('nl');

i18n.registerTranslation('nl', {
 'Nothing yet...': 'Nog Niet ...',
 '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} en {{ secondUser }} zijn aan het typen...',
});

<Chat client={chatClient} i18nInstance={i18n}>
 ...
</Chat>

You can use the same function to add whole new language.

const i18n = new Streami18n('it');

i18n.registerTranslation('it', {
 'Nothing yet...': 'Non ancora ...',
 '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} a {{ secondUser }} stanno scrivendo...',
});

// Make sure to call setLanguage to reflect new language in UI.
i18n.setLanguage('it');
<Chat client={chatClient} i18nInstance={i18n}>
 ...
</Chat>
TypeRequired
Streami18nNo

style

You can pass the theme object to customize the styles of Chat components. You can check the default theme in theme.ts

Please check section about themes in cookbook for details.

import type { DeepPartial, Theme } from 'stream-chat-react-native';

const theme: DeepPartial<Theme> = {
  messageSimple: {
    file: {
      container: {
        backgroundColor: 'red',
      },
      icon: {
        height: 16,
        width: 16,
      },
    },
  },
};

<Chat style={theme}>
</Chat>
TypeRequired
objectNo

The wrapper component for a chat channel. Channel needs to be placed inside a Chat component to receive the StreamChat client instance. MessageList, Thread, and MessageInput must be children of the Channel component to receive the ChannelContext.

channel

Instance of channel object from stream-chat package.

Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript

import { StreamChat, Channel } from 'stream-chat';
import { Chat, Channel} from 'stream-chat-react-native';

const client = StreamChat.getInstance('api_key');
await client.connectUser('user_id', 'user_token');
const channel = client.channel('messaging', 'channel_id');
await channel.watch();

<Chat client={client}>
 <Channel channel={channel}>
 </Channel>
</Chat>
TypeRequired
ChannelNo

EmptyStateIndicator

Custom UI component to display empty state when channel has no messages.

Default EmptyStateIndicator

TypeRequired
Component, elementNo

enforceUniqueReaction

When set to true, reactions will be limited to 1 per user. If user selects another reaction then his previous reaction will be removed and replaced with new one.

This is similar to reaction UX on iMessage application.

TypeRequired
booleanNo

giphyEnabled

When set to false, it will disable giphy command on MessageInput component.

TypeRequired
booleanNo

hideDateSeparators

Hide inline date separators on channel

TypeRequired
booleanNo

LoadingIndicator

Custom loading indicator to override the Stream default

TypeRequired
Component, elementNo

maxTimeBetweenGroupedMessages

Maximum time in milliseconds that should occur between messages to still consider them grouped together

TypeRequired
numberNo

NetworkDownIndicator

Custom network down indicator to override the Stream default

TypeRequired
Component, elementNo

StickyHeader

Custom UI component for sticky header of channel.

Default DateHeader

TypeRequired
Component, elementNo

client

The StreamChat client object

import { StreamChat } from 'stream-chat';
import { Chat } from 'stream-chat-react-native';

const client = StreamChat.getInstance('api_key);
await client.connectUser('user_id', 'userToken');

<Chat client={client}>
</Chat>
TypeRequired
StreamChatNo

AttachButton

Custom UI component for attach button.

Defaults to and accepts same props as: AttachButton

TypeRequired
Component, elementNo

CommandsButton

Custom UI component for commands button.

Defaults to and accepts same props as: CommandsButton

TypeRequired
Component, elementNo

editMessage

Full override of the edit message button in the Message Actions

Please check cookbook for details.

TypeRequired
(((message: UpdatedMessage<At, Ch, Co, Me, Re, Us>, userId?: string | { id: string; }) => Promise<UpdateMessageAPIResponse<At, Ch, Co, Me, Re, Us>>) & ((message: MessageType<...>) => MessageAction)) | undefinedNo

FileUploadPreview

Custom UI component for FileUploadPreview. Defaults to and accepts same props as: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageInput/FileUploadPreview.tsx

TypeRequired
Component, elementNo

hasCommands

When false, CommandsButton will be hidden

TypeRequired
booleanNo

hasFilePicker

When false, FileSelectorIcon will be hidden

TypeRequired
booleanNo

hasImagePicker

When false, ImageSelectorIcon will be hidden

TypeRequired
booleanNo

ImageUploadPreview

Custom UI component for ImageUploadPreview. Defaults to and accepts same props as: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageInput/ImageUploadPreview.tsx

TypeRequired
Component, elementNo

maxNumberOfFiles

Limit on allowed number of files to attach at a time.

TypeRequired
numberNo

MoreOptionsButton

Custom UI component for more options button.

Defaults to and accepts same props as: MoreOptionsButton

TypeRequired
Component, elementNo

numberOfLines

Limit on the number of lines in the text input before scrolling

TypeRequired
numberNo

SendButton

Custom UI component for send button.

Defaults to and accepts same props as: SendButton

TypeRequired
Component, elementNo

sendImageAsync

TypeRequired
booleanNo

ShowThreadMessageInChannelButton

Custom UI component to render checkbox with text ("Also send to channel") in Thread's input box. When ticked, message will also be sent in parent channel.

TypeRequired
Component, elementNo

UploadProgressIndicator

Custom UI component to render upload progress indicator on attachment preview.

Default UploadProgressIndicator

TypeRequired
Component, elementNo

additionalTextInputProps

Additional props for underlying TextInput component. These props will be forwarded as it is to TextInput component.

See https://reactnative.dev/docs/textinput#reference

TypeRequired
TextInputPropsNo

autoCompleteTriggerSettings

Mapping of input triggers to the outputs to be displayed by the AutoCompleteInput

TypeRequired
((settings: ACITriggerSettingsParams<At, Ch, Co, Ev, Me, Re, Us>) => TriggerSettings<Co, Us>)No

compressImageQuality

Compress image with quality (from 0 to 1, where 1 is best quality). On iOS, values larger than 0.8 don't produce a noticeable quality increase in most images, while a value of 0.8 will reduce the file size by about half or less compared to a value of 1. Image picker defaults to 0.8 for iOS and 1 for Android

TypeRequired
numberNo

doDocUploadRequest

Override file upload request

Arguments
file File object - { uri: '', name: '' }
channel Current channel object
TypeRequired
FunctionNo

doImageUploadRequest

Override image upload request

Arguments
file File object - { uri: '' }
channel Current channel object
TypeRequired
FunctionNo

initialValue

Initial value to set on input

TypeRequired
stringNo

Input

Custom UI component for AutoCompleteInput. Has access to all of MessageInputContext

TypeRequired
Component, elementNo

InputButtons

Custom UI component to override buttons on left side of input box Defaults to InputButtons, which contain following components/buttons:

  • AttachButton
  • CommandsButtom

You have access to following prop functions:

  • closeAttachmentPicker
  • openAttachmentPicker
  • openCommandsPicker
  • toggleAttachmentPicker
TypeRequired
Component, elementNo

onChangeText

Callback that is called when the text input's text changes. Changed text is passed as a single string argument to the callback handler.

TypeRequired
((newText: string) => void)No

setInputRef

ref for input setter function

TypeRequired
((ref: TextInput | null) => void)No

maxMessageLength

TypeRequired
numberNo

uploadsEnabled

TypeRequired
booleanNo

closeSuggestions

Override handler for closing suggestions (mentions, command autocomplete etc)

TypeRequired
(() => void)No

openSuggestions

Override handler for opening suggestions (mentions, command autocomplete etc)

Arguments
component UI Component for suggestion item.
title Title for suggestions box
TypeRequired
FunctionNo

updateSuggestions

Override handler for updating suggestions (mentions, command autocomplete etc)

Arguments
newSuggestions UI Component for suggestion item.
newSuggestionsTitle Title for suggestions box
TypeRequired
FunctionNo

componentType

TypeRequired
string | ReactElement<{ item: Suggestion<Co, Us>; }, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<...>)>No

suggestions

TypeRequired
Suggestions<Co, Us>No

suggestionsTitle

TypeRequired
ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>No

suggestionsViewActive

TypeRequired
booleanNo

t

TypeRequired
TFunction | ((key: string) => string)No

messages

Messages from client state

TypeRequired
FormatMessageResponse<At, Ch, Co, Me, Re, Us>[]No

loadingMore

Is loading more messages

TypeRequired
booleanNo

loadingMoreRecent

Is loading more recent messages

TypeRequired
booleanNo

additionalTouchableProps

Provide any additional props for TouchableOpacity which wraps inner MessageContent component here. Please check docs for TouchableOpacity for supported props - https://reactnative.dev/docs/touchableopacity#props

TypeRequired
ObjectNo

animatedLongPress

When false, pop-out animation will be disabled for message bubble, onLongPress

TypeRequired
booleanNo

Attachment

UI component for Attachment. Defaults to: Attachment

TypeRequired
Component, elementNo

AttachmentActions

UI component to display AttachmentActions. e.g., send, shuffle, cancel in case of giphy Defaults to: AttachmentActions

TypeRequired
Component, elementNo

FileAttachmentIcon

UI component for attachment icon for type 'file' attachment. Defaults to: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileIcon.tsx

TypeRequired
Component, elementNo

blockUser

Full override of the block user button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

Card

UI component to display generic media type e.g. giphy, url preview etc Defaults to: Card

TypeRequired
Component, elementNo

CardCover

Custom UI component to override default cover (between Header and Footer) of Card component. Accepts the same props as Card component.

TypeRequired
Component, elementNo

CardFooter

Custom UI component to override default Footer of Card component. Accepts the same props as Card component.

TypeRequired
Component, elementNo

CardHeader

Custom UI component to override default header of Card component. Accepts the same props as Card component.

TypeRequired
Component, elementNo

copyMessage

Full override of the copy message button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

DateHeader

UI component for DateHeader Defaults to: DateHeader

TypeRequired
Component, elementNo

deleteMessage

Full override of the delete message button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

disableTypingIndicator

TypeRequired
booleanNo

dismissKeyboardOnMessageTouch

Should keyboard be dismissed when messaged is touched

TypeRequired
booleanNo

FileAttachment

UI component to display File type attachment. Defaults to: FileAttachment

TypeRequired
Component, elementNo

FileAttachmentGroup

UI component to display group of File type attachments or multiple file attachments (in single message). Defaults to: FileAttachmentGroup

TypeRequired
Component, elementNo

flagMessage

Full override of the flag message button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

FlatList

TypeRequired
Component, elementNo

forceAlignMessages

Whether messages should be aligned to right or left part of screen. By default, messages will be received messages will be aligned to left and sent messages will be aligned to right.

TypeRequired
boolean | "right" | "left"No

formatDate

Optional function to custom format the message date

TypeRequired
((date: TDateTimeParserInput) => string)No

Gallery

UI component to display image attachments Defaults to: Gallery

TypeRequired
Component, elementNo

Giphy

UI component for Giphy Defaults to: Giphy

TypeRequired
Component, elementNo

handleBlock

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleCopy

Handler to access when a copy message action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleDelete

Handler to access when a delete message action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleEdit

Handler to access when an edit message action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void)No

handleFlag

Handler to access when a flag message action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleMute

Handler to access when a mute user action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleReaction

Handler to process a reaction

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>, reactionType: string) => Promise<void>)No

handleReply

Handler to access when a reply action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleRetry

Handler to access when a retry action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleThreadReply

Handler to access when a thread reply action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

InlineDateSeparator

UI component for Message Date Separator Component Defaults to: InlineDateSeparator

TypeRequired
Component, elementNo

InlineUnreadIndicator

UI component for InlineUnreadIndicator Defaults to: InlineUnreadIndicator

TypeRequired
Component, elementNo

markdownRules

Object specifying rules defined within simple-markdown https://github.com/Khan/simple-markdown#adding-a-simple-extension

TypeRequired
Partial<DefaultRules>No

Message

TypeRequired
Component, elementNo

messageActions

Use this prop to override message actions (which pop-up in message overlay).

You can either completely override the default messageActions object.

<Channel
  messageActions=[
    {
      action: () => { someAction() };
      title: "Pin Message";
      icon: PinIcon;
      titleStyle: {};
    },
    {
      action: () => { someAction() };
      title: "Delete Message";
      icon: PinIcon;
      titleStyle: {};
    }
  ]
>
</Channel>

Or you can selectly keep certain action and remove some:

e.g. Lets say you only want to keep threadReply and copyMessage actions

<Channel
  messageActions={({
    blockUser,
    copyMessage,
    deleteMessage,
    editMessage,
    flagMessage,
    muteUser,
    reply,
    retry,
    threadReply,
  }) => ([
    threadReply, copyMessage
  ])}
>
 </Channel>
TypeRequired
Function | Array<Objects>No

MessageAvatar

UI component for MessageAvatar Defaults to: MessageAvatar

TypeRequired
Component, elementNo

MessageContent

UI component for MessageContent Defaults to: MessageContent

TypeRequired
Component, elementNo

messageContentOrder

Order to render the message content

TypeRequired
MessageContentType[]No

MessageFooter

Custom message footer component

TypeRequired
Component, elementNo

MessageHeader

Custom message header component

TypeRequired
Component, elementNo

MessageList

TypeRequired
Component, elementNo

ScrollToBottomButton

UI component for ScrollToBottomButton Defaults to: ScrollToBottomButton

TypeRequired
Component, elementNo

MessageReplies

UI component for MessageReplies Defaults to: MessageReplies

TypeRequired
Component, elementNo

MessageRepliesAvatars

UI Component for MessageRepliesAvatars Defaults to: MessageRepliesAvatars

TypeRequired
Component, elementNo

MessageSimple

UI component for MessageSimple Defaults to: MessageSimple

TypeRequired
Component, elementNo

MessageStatus

UI component for MessageStatus (delivered/read) Defaults to: MessageStatus

TypeRequired
Component, elementNo

MessageSystem

UI component for MessageSystem Defaults to: MessageSystem

TypeRequired
Component, elementNo

MessageText

Custom UI component for message text

TypeRequired
Component, elementNo

muteUser

Full override of the mute user button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

myMessageTheme

Theme provided only to messages that are the current users

TypeRequired
DeepPartial<Theme>No

onDoubleTapMessage

Add double tap handler for message.

<Channel
 onDoubleTapMessage={({
   actionHandlers: {
       deleteMessage, // () => Promise<void>;
       editMessage, // () => void;
       reply, // () => void;
       resendMessage, // () => Promise<void>;
       showMessageOverlay, // () => void;
       toggleBanUser, // () => Promise<void>;
       toggleMuteUser, // () => Promise<void>;
       toggleReaction, // (reactionType: string) => Promise<void>;
   },
   message // message object on which longPress occured
 }) => {
   // Your custom action
 }}
/>
TypeRequired
((payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void)No

onLongPressMessage

Override default handler for onLongPress on message. You have access to payload of that handler as param:

<Channel
 onLongPressMessage={({
   actionHandlers: {
       deleteMessage, // () => Promise<void>;
       editMessage, // () => void;
       reply, // () => void;
       resendMessage, // () => Promise<void>;
       showMessageOverlay, // () => void;
       toggleBanUser, // () => Promise<void>;
       toggleMuteUser, // () => Promise<void>;
       toggleReaction, // (reactionType: string) => Promise<void>;
   },
   defaultHandler, // () => void
   event, // any event object corresponding to touchable feedback
   emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc
   message // message object on which longPress occured
 }) => {
   // Your custom action
 }}
/>
TypeRequired
((payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void)No

onPressInMessage

Add onPressIn handler for attachments. You have access to payload of that handler as param:

<Channel
 onPressInMessage={({
   actionHandlers: {
       deleteMessage, // () => Promise<void>;
       editMessage, // () => void;
       reply, // () => void;
       resendMessage, // () => Promise<void>;
       showMessageOverlay, // () => void;
       toggleBanUser, // () => Promise<void>;
       toggleMuteUser, // () => Promise<void>;
       toggleReaction, // (reactionType: string) => Promise<void>;
   },
   defaultHandler, // () => void
   event, // any event object corresponding to touchable feedback
   emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc
   message // message object on which longPress occured
 }) => {
   // Your custom action
 }}
/>
TypeRequired
((payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void)No

onPressMessage

Override onPress handler for message. You have access to payload of that handler as param:

<Channel
 onPressMessage={({
   actionHandlers: {
       deleteMessage, // () => Promise<void>;
       editMessage, // () => void;
       reply, // () => void;
       resendMessage, // () => Promise<void>;
       showMessageOverlay, // () => void;
       toggleBanUser, // () => Promise<void>;
       toggleMuteUser, // () => Promise<void>;
       toggleReaction, // (reactionType: string) => Promise<void>;
   },
   defaultHandler, // () => void
   event, // any event object corresponding to touchable feedback
   emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc
   message // message object on which longPress occured
 }) => {
   // Your custom action
 }}
/>
TypeRequired
((payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void)No

OverlayReactionList

UI component for OverlayReactionList

TypeRequired
Component, elementNo

ReactionList

UI component for ReactionList Defaults to: ReactionList

TypeRequired
Component, elementNo

Reply

UI component for Reply Defaults to: Reply

TypeRequired
Component, elementNo

reply

Full override of the reply button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

retry

Full override of the resend button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

selectReaction

Full override of the reaction function on Message and Message Overlay

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => (reactionType: string) => Promise<void>)No

supportedReactions

TypeRequired
ReactionData[]No

threadReply

Full override of the thread reply button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction)No

TypingIndicator

UI component for TypingIndicator Defaults to: TypingIndicator

TypeRequired
Component, elementNo

TypingIndicatorContainer

UI component for TypingIndicatorContainer Defaults to: TypingIndicatorContainer

TypeRequired
Component, elementNo

UrlPreview

TypeRequired
Component, elementNo

allowThreadMessagesInChannel

TypeRequired
booleanNo

thread

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "channel" | "text" | "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | ... 22 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; }) | nullNo

additionalKeyboardAvoidingViewProps

Additional props passed to keyboard avoiding view

TypeRequired
Partial<KeyboardAvoidingViewProps>No

disableIfFrozenChannel

Disables the channel UI if the channel is frozen

TypeRequired
booleanNo

disableKeyboardCompatibleView

When true, disables the KeyboardCompatibleView wrapper

Channel internally uses the KeyboardCompatibleView component to adjust the height of Channel when the keyboard is opened or dismissed. This prop provides the ability to disable this functionality in case you want to use KeyboardAvoidingView or handle dismissal yourself. KeyboardAvoidingView works well when your component occupies 100% of screen height, otherwise it may raise some issues.

TypeRequired
booleanNo

doMarkReadRequest

Overrides the Stream default mark channel read request (Advanced usage only)

Arguments
channel Channel object
TypeRequired
((channel: Channel<At, Ch, Co, Ev, Me, Re, Us>) => void)No

doSendMessageRequest

Overrides the Stream default send message request (Advanced usage only)

Arguments
channelId
messageData Message object
TypeRequired
((channelId: string, messageData: Message<At, Me, Us>) => Promise<SendMessageAPIResponse<At, Ch, Co, Me, Re, Us>>)No

doUpdateMessageRequest

Overrides the Stream default update message request (Advanced usage only)

Arguments
channelId
updatedMessage UpdatedMessage object
TypeRequired
((channelId: string, updatedMessage: UpdatedMessage<At, Ch, Co, Me, Re, Us>) => Promise<UpdateMessageAPIResponse<At, Ch, Co, Me, Re, Us>>)No

globalUnreadCountLimit

E.g. Once unread count exceeds 255, display unread count as 255+ instead of actual count. Also 255 is the limit per Stream chat channel for unread count.

TypeRequired
numberNo

initialScrollToFirstUnreadMessage

When true, messageList will be scrolled at first unread message, when opened.

TypeRequired
booleanNo

keyboardBehavior

TypeRequired
"height" | "position" | "padding"No

KeyboardCompatibleView

Custom wrapper component that handles height adjustment of Channel component when keyboard is opened or dismissed Default component (accepts the same props): KeyboardCompatibleView

Example:

<Channel
 channel={channel}
 KeyboardCompatibleView={(props) => {
   return (
     <KeyboardCompatibleView>
       {props.children}
     </KeyboardCompatibleView>
   )
 }}
/>
TypeRequired
Component, elementNo

keyboardVerticalOffset

TypeRequired
numberNo

LoadingErrorIndicator

Custom loading error indicator to override the Stream default

TypeRequired
Component, elementNo

messageId

TypeRequired
stringNo

Note: The Channel component provides access to the values stored in ChannelContext, MessagesContext, and ThreadContext and exposes their hooks or the withChannelContext, withMessagesContext, and withThreadContext higher order components.

The example below shows how to write a component that consumes a context and uses hooks.

import React from 'react';
import { Text, View } from 'react-native';

import { Chat, Channel, MessageInput, MessageList, useChannelContext } from 'stream-chat-react-native';

const CustomChannelHeader = () => {
  const { channel, loading } = useChannelContext();

  return loading ? (
    <View>
      <Text>Channel is loading...</Text>
    </View>
  ) : (
    <View>
      <Text>Channel ID: {channel.cid}</Text>
      <Text>
        There are currently {channel.state.watcher_count} people online
      </Text>
    </View>
  );
};

<OverlayProvider>
  <View>
    <Chat client={chat}>
      <Channel channel={dataChannel}>
        <CustomChannelHeader />
        <MessageList />
        <MessageInput />
      </Channel>
    </Chat>
  </View>
</OverlayProvider>

Thread - The Thread renders a parent message with a list of replies. Use the standard message list of the main channel's messages. The thread is only used for the list of replies to a message.

Thread is a consumer of channel context Underlying MessageList, MessageInput and Message components can be customized using props:

  • additionalMessageListProps
  • additionalMessageInputProps

MessageList

TypeRequired
Component, elementNo

closeThread

TypeRequired
(() => void)No

loadMoreThread

TypeRequired
(() => Promise<void>)No

thread

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "channel" | "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 22 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; }) | nullNo

additionalMessageInputProps

Additional props for underlying MessageInput component. Available props - https://getstream.github.io/stream-chat-react-native/v3/#messageinput

TypeRequired
Partial<Partial<MessageInputPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>>>No

additionalMessageListProps

Additional props for underlying MessageList component. Available props - https://getstream.github.io/stream-chat-react-native/v3/#messagelist

TypeRequired
Partial<Partial<MessageListPropsWithContext<At, Ch, Co, Ev, Me, Re, Us>>>No

autoFocus

Make input focus on mounting thread

TypeRequired
booleanNo

closeThreadOnDismount

Closes thread on dismount, defaults to true

TypeRequired
booleanNo

disabled

Disables the thread UI. So MessageInput and MessageList will be disabled.

TypeRequired
booleanNo

MessageInput

Customized MessageInput component to used within Thread instead of default MessageInput Available from MessageInput

TypeRequired
Component, elementNo

onThreadDismount

Call custom function on closing thread if handling thread state elsewhere

TypeRequired
(() => void)No

This component fetches a list of channels, allowing you to select the channel you want to open. The ChannelList doesn't provide any UI for the underlying React Native FlatList. UI is determined by the List component which is provided to the ChannelList component as a prop. By default, the ChannelListMessenger component is used as the list UI.

additionalFlatListProps

Besides the existing default behavior of the ChannelListMessenger component, you can attach additional props to the underlying React Native FlatList.

You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props

EXAMPLE:

<ChannelListMessenger
 channels={channels}
 additionalFlatListProps={{ bounces: true }}
/>

Note: Don't use additionalFlatListProps to access the FlatList ref, use setFlatListRef

TypeRequired
Partial<FlatListProps<Channel<At, Ch, Co, Ev, Me, Re, Us>>>No

EmptyStateIndicator

Custom indicator to use when channel list is empty

Default: EmptyStateIndicator

TypeRequired
Component, elementNo

FooterLoadingIndicator

Custom loading indicator to display at bottom of the list, while loading further pages

Default: ChannelListFooterLoadingIndicator

TypeRequired
Component, elementNo

HeaderErrorIndicator

Custom indicator to display error at top of list, if loading/pagination error occurs

Default: ChannelListHeaderErrorIndicator

TypeRequired
Component, elementNo

HeaderNetworkDownIndicator

Custom indicator to display network-down error at top of list, if there is connectivity issue

Default: ChannelListHeaderNetworkDownIndicator

TypeRequired
Component, elementNo

LoadingErrorIndicator

Custom indicator to use when there is error in fetching channels

Default: LoadingErrorIndicator

TypeRequired
Component, elementNo

LoadingIndicator

Custom loading indicator to use on Channel List

TypeRequired
Component, elementNo

Preview

Custom UI component to display individual channel list items

Default: ChannelPreviewMessenger

TypeRequired
Component, elementNo

setFlatListRef

Function to gain access to the inner FlatList ref

Example:

<ChannelListMessenger
 setFlatListRef={(ref) => {
   // Use ref for your own good
 }}
TypeRequired
((ref: FlatList<Channel<At, Ch, Co, Ev, Me, Re, Us>> | null) => void)No

ListHeaderComponent

TypeRequired
Component, elementNo

onSelect

Function to set the currently active channel, acts as a bridge between ChannelList and Channel components

Arguments
channel A channel object
TypeRequired
((channel: Channel<At, Ch, Co, Ev, Me, Re, Us>) => void)No

PreviewAvatar

Custom UI component to render preview avatar.

Default ChannelAvatar

TypeRequired
Component, elementNo

PreviewMessage

Custom UI component to render preview of latest message on channel.

Default ChannelPreviewMessage

TypeRequired
Component, elementNo

PreviewStatus

Custom UI component to render preview avatar.

Default ChannelPreviewStatus

TypeRequired
Component, elementNo

PreviewTitle

Custom UI component to render preview avatar.

Default ChannelPreviewTitle

TypeRequired
Component, elementNo

PreviewUnreadCount

Custom UI component to render preview avatar.

Default ChannelPreviewUnreadCount

TypeRequired
Component, elementNo

loadMoreThreshold

The React Native FlatList threshold to fetch more data

See loadMoreThreshold doc

TypeRequired
numberNo

Skeleton

Custom UI component to display loading channel skeletons

Default: Skeleton

TypeRequired
Component, elementNo

maxUnreadCount

Max number to display within notification badge. Default: 255 and it cannot be higher than that for now due to backend limitations

TypeRequired
numberNo

numberOfSkeletons

Number of skeletons that should show when loading. Default: 6

TypeRequired
numberNo

filters

Object containing channel query filters

See Channel query documentation for a list of available filter fields

TypeRequired
objectNo

List

Custom UI component to display the list of channels

Default: ChannelListMessenger

TypeRequired
Component, elementNo

lockChannelOrder

If set to true, channels won't dynamically sort by most recent message, defaults to false

TypeRequired
booleanNo

onAddedToChannel

Function that overrides default behavior when a user gets added to a channel

Arguments
setChannels Setter for internal state property - channels. It's created from useState() hook.
event An Event Object corresponding to notification.added_to_channel event
TypeRequired
FunctionNo

onChannelDeleted

Function that overrides default behavior when a channel gets deleted. In absence of this prop, the channel will be removed from the list.

Arguments
setChannels Setter for internal state property - channels. It's created from useState() hook.
event An Event object corresponding to channel.deleted event
TypeRequired
FunctionNo

onChannelHidden

Function that overrides default behavior when a channel gets hidden. In absence of this prop, the channel will be removed from the list.

Arguments
setChannels Setter for internal state property - channels. It's created from useState() hook.
event An Event object corresponding to channel.hidden event
TypeRequired
FunctionNo

onChannelTruncated

Function to customize behavior when a channel gets truncated

Arguments
setChannels Setter for internal state property - channels. It's created from useState() hook.
TypeRequired
((setChannels: Dispatch<SetStateAction<Channel<At, Ch, Co, Ev, Me, Re, Us>[]>>, event: Event<At, Ch, Co, Ev, Me, Re, Us>) => void)No

onChannelUpdated

Function that overrides default behavior when a channel gets updated

Arguments
setChannels Setter for internal state property - channels. It's created from useState() hook.
event An Event object corresponding to channel.updated event
TypeRequired
FunctionNo

onMessageNew

Override the default listener/handler for event notification.message_new This event is received on channel, which is not being watched.

Arguments
setChannels Setter for internal state property - channels. It's created from useState() hook.
event An Event object corresponding to notification.message_new event
TypeRequired
FunctionNo

onRemovedFromChannel

Function that overrides default behavior when a user gets removed from a channel

Arguments
setChannels Setter for internal state property - channels. It's created from useState() hook.
event An Event object corresponding to notification.removed_from_channel event
TypeRequired
FunctionNo

options

Object containing channel query options

See Channel query documentation for a list of available option fields

TypeRequired
ChannelOptionsNo

sort

Object containing channel sort parameters

See Channel query documentation for a list of available sorting fields

TypeRequired
ChannelSortBase<Ch> | ChannelSortBase<Ch>[]No

import { View }  from 'react-native';
import { Chat, ChannelList } from 'stream-chat-react-native';

<OverlayProvider>
    <View>
        <Chat client={client}>
            <ChannelList
                filters={{
                    members: {
                        $in: ['vishal', 'neil']
                    }
                }}
            />
        </Chat>
    </View>
</OverlayProvider>

This UI component displays the preview list of channels and handles Channel navigation. It receives all props from the ChannelList component.

additionalFlatListProps

Besides the existing default behavior of the ChannelListMessenger component, you can attach additional props to the underlying React Native FlatList.

You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props

EXAMPLE:

<ChannelListMessenger
 channels={channels}
 additionalFlatListProps={{ bounces: true }}
/>

Note: Don't use additionalFlatListProps to access the FlatList ref, use setFlatListRef

TypeRequired
Partial<FlatListProps<Channel<At, Ch, Co, Ev, Me, Re, Us>>>No

channels

Channels can be either an array of channels or a promise which resolves to an array of channels

TypeRequired
Channel<At, Ch, Co, Ev, Me, Re, Us>[]No

EmptyStateIndicator

Custom indicator to use when channel list is empty

Default: EmptyStateIndicator

TypeRequired
Component, elementNo

error

Error in channels query, if any

TypeRequired
booleanNo

FooterLoadingIndicator

Custom loading indicator to display at bottom of the list, while loading further pages

Default: ChannelListFooterLoadingIndicator

TypeRequired
Component, elementNo

forceUpdate

Incremental number change to force update the FlatList

TypeRequired
numberNo

loadingChannels

Initial channels query loading state, triggers the LoadingIndicator

TypeRequired
booleanNo

LoadingErrorIndicator

Custom indicator to use when there is error in fetching channels

Default: LoadingErrorIndicator

TypeRequired
Component, elementNo

LoadingIndicator

Custom loading indicator to use on Channel List

TypeRequired
Component, elementNo

loadingNextPage

Whether or not additional channels are being loaded, triggers the FooterLoadingIndicator

TypeRequired
booleanNo

loadMoreThreshold

The React Native FlatList threshold to fetch more data

See loadMoreThreshold doc

TypeRequired
numberNo

loadNextPage

Loads the next page of channels, which is present as a required prop

TypeRequired
((queryType?: string, retryCount?: number | undefined) => Promise<void>) | undefinedNo

refreshing

Triggered when the channel list is refreshing, displays a loading spinner at the top of the list

TypeRequired
booleanNo

refreshList

Function to refresh the channel list that is similar to reloadList, but it doesn't wipe out existing channels from UI before loading the new ones

TypeRequired
(() => void | Promise<void>)No

reloadList

Removes all the existing channels from UI and loads fresh channels

TypeRequired
(() => Promise<void>)No

setFlatListRef

Function to gain access to the inner FlatList ref

Example:

<ChannelListMessenger
 setFlatListRef={(ref) => {
   // Use ref for your own good
 }}
TypeRequired
((ref: FlatList<Channel<At, Ch, Co, Ev, Me, Re, Us>> | null) => void)No

ListHeaderComponent

TypeRequired
Component, elementNo

PreviewMessage

Custom UI component to render preview of latest message on channel.

Default ChannelPreviewMessage

TypeRequired
Component, elementNo

PreviewUnreadCount

Custom UI component to render preview avatar.

Default ChannelPreviewUnreadCount

TypeRequired
Component, elementNo

import { View }  from 'react-native';
import { Chat, ChannelList, ChannelListMessenger } from 'stream-chat-react-native';

<OverlayProvider>
    <View>
        <Chat client={client}>
            <ChannelList
                List={ChannelListMessenger}
                filters={{
                    members: {
                        $in: ['vishal', 'neil']
                    }
                }}
            />
        </Chat>
    </View>
</OverlayProvider>

client

The StreamChat client object

import { StreamChat } from 'stream-chat';
import { Chat } from 'stream-chat-react-native';

const client = StreamChat.getInstance('api_key);
await client.connectUser('user_id', 'userToken');

<Chat client={client}>
</Chat>
TypeRequired
StreamChatNo

Preview

Custom UI component to display individual channel list items

Default: ChannelPreviewMessenger

TypeRequired
Component, elementNo

channel

The previewed channel

TypeRequired
Channel<At, Ch, Co, Ev, Me, Re, Us>No

This UI component displays an individual preview item for each channel in a list. It also receives all props from the ChannelPreview component.

maxUnreadCount

Max number to display within notification badge. Default: 255 and it cannot be higher than that for now due to backend limitations

TypeRequired
numberNo

onSelect

Function to set the currently active channel, acts as a bridge between ChannelList and Channel components

Arguments
channel A channel object
TypeRequired
((channel: Channel<At, Ch, Co, Ev, Me, Re, Us>) => void)No

PreviewAvatar

Custom UI component to render preview avatar.

Default ChannelAvatar

TypeRequired
Component, elementNo

PreviewMessage

Custom UI component to render preview of latest message on channel.

Default ChannelPreviewMessage

TypeRequired
Component, elementNo

PreviewStatus

Custom UI component to render preview avatar.

Default ChannelPreviewStatus

TypeRequired
Component, elementNo

PreviewTitle

Custom UI component to render preview avatar.

Default ChannelPreviewTitle

TypeRequired
Component, elementNo

PreviewUnreadCount

Custom UI component to render preview avatar.

Default ChannelPreviewUnreadCount

TypeRequired
Component, elementNo

formatLatestMessageDate

Formatter function for date of latest message.

Arguments
date Message date
Returns
Formatted date stringBy default today's date is shown in 'HH:mm A' format and other dates are displayed in 'DD/MM/YY' format. props.latestMessage.created_at is the default formatted date. This default logic is part of ChannelPreview component.
TypeRequired
((date: Date) => string)No

unread

Number of unread messages on the channel

TypeRequired
numberNo

channel

The previewed channel

TypeRequired
Channel<At, Ch, Co, Ev, Me, Re, Us>No

latestMessagePreview

Latest message on a channel, formatted for preview

e.g.,

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

latestMessagePreview

Latest message on a channel, formatted for preview

e.g.,

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

formatLatestMessageDate

Formatter function for date of latest message.

Arguments
date Message date
Returns
Formatted date stringBy default today's date is shown in 'HH:mm A' format and other dates are displayed in 'DD/MM/YY' format. props.latestMessage.created_at is the default formatted date. This default logic is part of ChannelPreview component.
TypeRequired
((date: Date) => string)No

channel

The previewed channel

TypeRequired
Channel<At, Ch, Co, Ev, Me, Re, Us>No

latestMessagePreview

TypeRequired
LatestMessagePreview<DefaultAttachmentType, DefaultChannelType, LiteralStringForUnion, Record<string, unknown>, Record<string, unknown>, Record<...>, DefaultUserType>No

channel

The previewed channel

TypeRequired
Channel<At, Ch, Co, Ev, Me, Re, Us>No

displayName

TypeRequired
stringNo

Attachment - The message attachment

AttachmentActions

UI component to display AttachmentActions. e.g., send, shuffle, cancel in case of giphy Defaults to: AttachmentActions

TypeRequired
Component, elementNo

Card

UI component to display generic media type e.g. giphy, url preview etc Defaults to: Card

TypeRequired
Component, elementNo

FileAttachment

UI component to display File type attachment. Defaults to: FileAttachment

TypeRequired
Component, elementNo

Gallery

UI component to display image attachments Defaults to: Gallery

TypeRequired
Component, elementNo

Giphy

UI component for Giphy Defaults to: Giphy

TypeRequired
Component, elementNo

UrlPreview

TypeRequired
Component, elementNo

attachment

The attachment to render

TypeRequired
Record<string, unknown> & { actions?: Action[] | undefined; asset_url?: string | undefined; author_icon?: string | undefined; author_link?: string | undefined; author_name?: string | undefined; ... 12 more ...; type?: string | undefined; }No

AttachmentActions - The actions you can take on an attachment. Actions in combination with attachments can be used to build commands.

actions

TypeRequired
Action[]No

asset_url

TypeRequired
stringNo

author_icon

TypeRequired
stringNo

author_link

TypeRequired
stringNo

author_name

TypeRequired
stringNo

color

TypeRequired
stringNo

fallback

TypeRequired
stringNo

fields

TypeRequired
Field[]No

footer

TypeRequired
stringNo

footer_icon

TypeRequired
stringNo

image_url

TypeRequired
stringNo

og_scrape_url

TypeRequired
stringNo

pretext

TypeRequired
stringNo

text

TypeRequired
stringNo

thumb_url

TypeRequired
stringNo

title

TypeRequired
stringNo

title_link

TypeRequired
stringNo

type

TypeRequired
stringNo

handleAction

Handler for actions. Actions in combination with attachments can be used to build commands.

TypeRequired
ActionHandlerNo

UI component for card in attachments.

actions

TypeRequired
Action[]No

asset_url

TypeRequired
stringNo

author_icon

TypeRequired
stringNo

author_link

TypeRequired
stringNo

author_name

TypeRequired
stringNo

color

TypeRequired
stringNo

fallback

TypeRequired
stringNo

fields

TypeRequired
Field[]No

footer

TypeRequired
stringNo

footer_icon

TypeRequired
stringNo

image_url

TypeRequired
stringNo

og_scrape_url

TypeRequired
stringNo

pretext

TypeRequired
stringNo

text

TypeRequired
stringNo

thumb_url

TypeRequired
stringNo

title

TypeRequired
stringNo

title_link

TypeRequired
stringNo

type

TypeRequired
stringNo

onLongPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we show the overlay with all the message actions on long press.

Arguments
event Event object for onLongPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we will dismiss the keyboard on press.

Arguments
event Event object for onPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onPressIn

TypeRequired
((payload: TouchableHandlerPayload) => void) | nullNo

additionalTouchableProps

Provide any additional props for TouchableOpacity which wraps inner MessageContent component here. Please check docs for TouchableOpacity for supported props - https://reactnative.dev/docs/touchableopacity#props

TypeRequired
ObjectNo

CardCover

Custom UI component to override default cover (between Header and Footer) of Card component. Accepts the same props as Card component.

TypeRequired
Component, elementNo

CardFooter

Custom UI component to override default Footer of Card component. Accepts the same props as Card component.

TypeRequired
Component, elementNo

CardHeader

Custom UI component to override default header of Card component. Accepts the same props as Card component.

TypeRequired
Component, elementNo

onLongPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we show the overlay with all the message actions on long press.

Arguments
event Event object for onLongPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we will dismiss the keyboard on press.

Arguments
event Event object for onPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onPressIn

TypeRequired
((payload: TouchableHandlerPayload) => void) | nullNo

additionalTouchableProps

Provide any additional props for TouchableOpacity which wraps inner MessageContent component here. Please check docs for TouchableOpacity for supported props - https://reactnative.dev/docs/touchableopacity#props

TypeRequired
ObjectNo

AttachmentActions

UI component to display AttachmentActions. e.g., send, shuffle, cancel in case of giphy Defaults to: AttachmentActions

TypeRequired
Component, elementNo

FileAttachmentIcon

UI component for attachment icon for type 'file' attachment. Defaults to: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileIcon.tsx

TypeRequired
Component, elementNo

attachmentSize

TypeRequired
numberNo

styles

TypeRequired
Partial<{ container: StyleProp<ViewStyle>; details: StyleProp<ViewStyle>; size: StyleProp<TextStyle>; title: StyleProp<TextStyle>; }>No

attachment

The attachment to render

TypeRequired
Record<string, unknown> & { file_size?: string | number | undefined; mime_type?: string | undefined; } & { actions?: Action[] | undefined; asset_url?: string | undefined; ... 15 more ...; type?: string | undefined; }No

files

The files attached to a message

TypeRequired
Attachment<At>[]No

Attachment

UI component for Attachment. Defaults to: Attachment

TypeRequired
Component, elementNo

styles

TypeRequired
Partial<{ attachmentContainer: StyleProp<ViewStyle>; container: StyleProp<ViewStyle>; }>No

messageId

The unique id for the message with file attachments

TypeRequired
stringNo

mimeType

TypeRequired
stringNo

size

TypeRequired
numberNo

UI component for card in attachments.

setImage

TypeRequired
Dispatch<SetStateAction<{ messageId?: string; url?: string | undefined; } | undefined>> | undefinedNo

alignment

Position of the message, either 'right' or 'left'

TypeRequired
"right" | "left"No

groupStyles

Position of message in group - top, bottom, middle, single.

Message group is a group of consecutive messages from same user. groupStyles can be used to style message as per their position in message group e.g., user avatar (to which message belongs to) is only showed for last (bottom) message in group.

TypeRequired
GroupType[]No

images

The images attached to a message

TypeRequired
Attachment<At>[]No

onLongPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we show the overlay with all the message actions on long press.

Arguments
event Event object for onLongPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we will dismiss the keyboard on press.

Arguments
event Event object for onPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onPressIn

TypeRequired
((payload: TouchableHandlerPayload) => void) | nullNo

threadList

Whether or not the Message is part of a Thread

TypeRequired
booleanNo

additionalTouchableProps

Provide any additional props for TouchableOpacity which wraps inner MessageContent component here. Please check docs for TouchableOpacity for supported props - https://reactnative.dev/docs/touchableopacity#props

TypeRequired
ObjectNo

setBlurType

TypeRequired
Dispatch<SetStateAction<BlurType>>No

setOverlay

TypeRequired
Dispatch<SetStateAction<Overlay>>No

hasThreadReplies

TypeRequired
booleanNo

messageId

TypeRequired
stringNo

messageText

TypeRequired
stringNo

preventPress

TypeRequired
booleanNo

UI component for card in attachments.

onLongPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we show the overlay with all the message actions on long press.

Arguments
event Event object for onLongPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onPressIn

TypeRequired
((payload: TouchableHandlerPayload) => void) | nullNo

additionalTouchableProps

Provide any additional props for TouchableOpacity which wraps inner MessageContent component here. Please check docs for TouchableOpacity for supported props - https://reactnative.dev/docs/touchableopacity#props

TypeRequired
ObjectNo

attachment

TypeRequired
Record<string, unknown> & { actions?: Action[] | undefined; asset_url?: string | undefined; author_icon?: string | undefined; author_link?: string | undefined; author_name?: string | undefined; ... 12 more ...; type?: string | undefined; }No

imageGalleryCustomComponents

Override props for following UI components, which are part of image gallery.

e.g.,

{
 footer: {
   ShareIcon: CustomShareIconComponent
 },
 grid: {
   avatarComponent: CustomAvatarComponent
 },
 gridHandle: {
   centerComponent: CustomCenterComponent
 },
 header: {
   CloseIcon: CustomCloseButtonComponent
 },
}
TypeRequired
objectNo

overlayOpacity

TypeRequired
SharedValue<number>No

visible

TypeRequired
booleanNo

imageGalleryGridHandleHeight

TypeRequired
numberNo

imageGalleryGridSnapPoints

This should be

TypeRequired
[string | number, string | number]No

AttachmentPickerBottomSheetHandle

Custom UI component to render draggable handle of attachment picker.

Default AttachmentPickerBottomSheetHandle

TypeRequired
Component, elementNo

AttachmentPickerError

Custom UI component to render error component while opening attachment picker.

Default AttachmentPickerError

TypeRequired
Component, elementNo

AttachmentPickerErrorImage

Custom UI component to render error image for attachment picker

Default AttachmentPickerErrorImage

TypeRequired
Component, elementNo

ImageOverlaySelectedComponent

Custom UI component to render overlay component, that shows up on top of selected image (with tick mark)

Default ImageOverlaySelectedComponent

TypeRequired
Component, elementNo

attachmentPickerErrorText

TypeRequired
stringNo

ref

TypeRequired
((instance: BottomSheetMethods | null) => void) | RefObject<BottomSheetMethods> | nullNo

key

TypeRequired
string | number | nullNo

giphyEnabled

When set to false, it will disable giphy command on MessageInput component.

TypeRequired
booleanNo

numberOfLines

Limit on the number of lines in the text input before scrolling

TypeRequired
numberNo

additionalTextInputProps

Additional props for underlying TextInput component. These props will be forwarded as it is to TextInput component.

See https://reactnative.dev/docs/textinput#reference

TypeRequired
TextInputPropsNo

maxMessageLength

TypeRequired
numberNo

giphyActive

TypeRequired
booleanNo

onChange

TypeRequired
((newText: string) => void)No

setGiphyActive

TypeRequired
Dispatch<SetStateAction<boolean>>No

setInputBoxRef

Ref callback to set reference on input box

TypeRequired
((ref: TextInput | null) => void)No

setShowMoreOptions

TypeRequired
Dispatch<SetStateAction<boolean>>No

text

Text value of the TextInput

TypeRequired
stringNo

triggerSettings

Mapping of input triggers to the outputs to be displayed by the AutoCompleteInput

TypeRequired
TriggerSettings<Co, Us>No

closeSuggestions

Override handler for closing suggestions (mentions, command autocomplete etc)

TypeRequired
(() => void)No

openSuggestions

Override handler for opening suggestions (mentions, command autocomplete etc)

Arguments
component UI Component for suggestion item.
title Title for suggestions box
TypeRequired
FunctionNo

updateSuggestions

Override handler for updating suggestions (mentions, command autocomplete etc)

Arguments
newSuggestions UI Component for suggestion item.
newSuggestionsTitle Title for suggestions box
TypeRequired
FunctionNo

t

TypeRequired
TFunction | ((key: string) => string)No

item

A CommandResponse of suggested CommandTypes with these properties

  • args: Arguments which can be passed to the command
  • name: Name of the command
TypeRequired
CommandResponse<Co>No

item

A EmojiResponse of suggested EmojiTypes with these properties

  • name: Name of emoji
  • unicode: Emoji unicode value
TypeRequired
EmojiNo

item

A UserResponse of suggested UserTypes with these properties

  • id: User ID of the suggested mention user
  • image: Image to be shown as the Avatar for the user
  • name: Name of the suggested mention user
TypeRequired
Record<string, unknown> & { image?: string | undefined; } & { id: string; anon?: boolean | undefined; name?: string | undefined; role?: string | undefined; teams?: string[] | undefined; username?: string | undefined; } & { ...; }No

active

TypeRequired
booleanNo

componentType

TypeRequired
SuggestionComponentType<Co, Us>No

suggestions

TypeRequired
Suggestions<Co, Us>No

suggestionsTitle

TypeRequired
ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>No

listType

TypeRequired
"channel" | "message" | "default"No

error

TypeRequired
booleanNo

listType

TypeRequired
"channel" | "message" | "default"No

loadNextPage

TypeRequired
(() => Promise<void>)No

retry

TypeRequired
(() => void)No

UI Component for LoadingIndicator

listType

TypeRequired
"channel" | "message" | "default"No

loadingText

TypeRequired
stringNo

closePicker

TypeRequired
(() => void)No

selectedPicker

TypeRequired
"images"No

setSelectedPicker

TypeRequired
Dispatch<SetStateAction<"images">> | undefinedNo

channel

Instance of channel object from stream-chat package.

Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript

import { StreamChat, Channel } from 'stream-chat';
import { Chat, Channel} from 'stream-chat-react-native';

const client = StreamChat.getInstance('api_key');
await client.connectUser('user_id', 'user_token');
const channel = client.channel('messaging', 'channel_id');
await channel.watch();

<Chat client={client}>
 <Channel channel={channel}>
 </Channel>
</Chat>
TypeRequired
ChannelNo

disabled

TypeRequired
booleanNo

EmptyStateIndicator

Custom UI component to display empty state when channel has no messages.

Default EmptyStateIndicator

TypeRequired
Component, elementNo

loadChannelAtMessage

TypeRequired
(({ after, before, messageId, }: { after?: number; before?: number | undefined; messageId?: string | undefined; }) => Promise<void>) | undefinedNo

loading

TypeRequired
booleanNo

LoadingIndicator

Custom loading indicator to override the Stream default

TypeRequired
Component, elementNo

markRead

TypeRequired
(() => void)No

NetworkDownIndicator

Custom network down indicator to override the Stream default

TypeRequired
Component, elementNo

reloadChannel

TypeRequired
(() => Promise<void>)No

scrollToFirstUnreadThreshold

When true, messagelist will be scrolled to first unread message, when opened.

TypeRequired
numberNo

setTargetedMessage

TypeRequired
((messageId: string) => void)No

StickyHeader

Custom UI component for sticky header of channel.

Default DateHeader

TypeRequired
Component, elementNo

targetedMessage

Id of message, around which Channel/MessageList gets loaded when opened. You will see a highlighted background for targetted message, when opened.

TypeRequired
stringNo

typingEventsEnabled

TypeRequired
booleanNo

client

The StreamChat client object

import { StreamChat } from 'stream-chat';
import { Chat } from 'stream-chat-react-native';

const client = StreamChat.getInstance('api_key);
await client.connectUser('user_id', 'userToken');

<Chat client={client}>
</Chat>
TypeRequired
StreamChatNo

isOnline

TypeRequired
booleanNo

setImages

TypeRequired
Dispatch<SetStateAction<MessageType<At, Ch, Co, Ev, Me, Re, Us>[]>>No

loadMore

Load more messages

TypeRequired
(() => Promise<void>)No

loadMoreRecent

Load more recent messages

TypeRequired
(() => Promise<void>)No

overlay

TypeRequired
"alert" | "gallery" | "message" | "none"No

DateHeader

UI component for DateHeader Defaults to: DateHeader

TypeRequired
Component, elementNo

disableTypingIndicator

TypeRequired
booleanNo

FlatList

TypeRequired
Component, elementNo

initialScrollToFirstUnreadMessage

When true, messageList will be scrolled at first unread message, when opened.

TypeRequired
booleanNo

InlineDateSeparator

UI component for Message Date Separator Component Defaults to: InlineDateSeparator

TypeRequired
Component, elementNo

InlineUnreadIndicator

UI component for InlineUnreadIndicator Defaults to: InlineUnreadIndicator

TypeRequired
Component, elementNo

Message

TypeRequired
Component, elementNo

ScrollToBottomButton

UI component for ScrollToBottomButton Defaults to: ScrollToBottomButton

TypeRequired
Component, elementNo

MessageSystem

UI component for MessageSystem Defaults to: MessageSystem

TypeRequired
Component, elementNo

myMessageTheme

Theme provided only to messages that are the current users

TypeRequired
DeepPartial<Theme>No

TypingIndicator

UI component for TypingIndicator Defaults to: TypingIndicator

TypeRequired
Component, elementNo

TypingIndicatorContainer

UI component for TypingIndicatorContainer Defaults to: TypingIndicatorContainer

TypeRequired
Component, elementNo

loadMoreThread

TypeRequired
(() => Promise<void>)No

thread

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "channel" | "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 22 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; }) | nullNo

t

TypeRequired
TFunction | ((key: string) => string)No

tDateTimeParser

TypeRequired
TDateTimeParserNo

additionalFlatListProps

Besides existing (default) UX behavior of underlying FlatList of MessageList component, if you want to attach some additional props to underlying FlatList, you can add it to following prop.

You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props

NOTE Don't use additionalFlatListProps to get access to ref of flatlist. Use setFlatListRef instead.

e.g. js <MessageList additionalFlatListProps={{ bounces: true, keyboardDismissMode: true }} />

TypeRequired
Partial<FlatListProps<MessageType<At, Ch, Co, Ev, Me, Re, Us>>>No

FooterComponent

UI component for footer of message list. By default message list will use InlineLoadingMoreIndicator as FooterComponent. If you want to implement your own inline loading indicator, you can access loadingMore from context.

This is a ListHeaderComponent of FlatList used in MessageList. Should be used for header by default if inverted is true or defaulted

TypeRequired
Component, elementNo

HeaderComponent

UI component for header of message list. By default message list will use InlineLoadingMoreRecentIndicator as HeaderComponent. If you want to implement your own inline loading indicator, you can access loadingMoreRecent from context.

This is a ListFooterComponent of FlatList used in MessageList. Should be used for header if inverted is false

TypeRequired
Component, elementNo

inverted

Whether or not the FlatList is inverted. Defaults to true

TypeRequired
booleanNo

noGroupByUser

Turn off grouping of messages by user

TypeRequired
booleanNo

onListScroll

TypeRequired
((event: NativeSyntheticEvent<NativeScrollEvent>) => void)No

onThreadSelect

Handler to open the thread on message. This is callback for touch event for replies button.

Arguments
message A message object to open the thread upon.
TypeRequired
((message: FormatMessageResponse<At, Ch, Co, Me, Re, Us> | MessagesWithStylesReadByAndDateSeparator<At, Ch, Co, Me, Re, Us> | null) => void)No

setFlatListRef

Use setFlatListRef to get access to ref to inner FlatList.

e.g. js <MessageList setFlatListRef={(ref) => { // Use ref for your own good }}

TypeRequired
((ref: FlatList<MessageType<At, Ch, Co, Ev, Me, Re, Us>> | null) => void)No

threadList

Boolean whether or not the Messages in the MessageList are part of a Thread

TypeRequired
booleanNo

A component to display system message. e.g, when someone updates the channel, they can attach a message with that update. That message will be available in message list as (type) system message.

message

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 23 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

formatDate

Formatter function for date object.

Arguments
date TDateTimeParserInput object of message
Returns string
TypeRequired
((date: TDateTimeParserInput) => string)No

style

TypeRequired
StyleProp<ViewStyle>No

onPress

onPress handler

TypeRequired
(event: GestureResponderEvent) => voidNo

showNotification

If we should show the notification or not

TypeRequired
booleanNo

unreadCount

TypeRequired
numberNo

typing

TypeRequired
Record<string, Event<At, Ch, Co, Ev, Me, Re, Us>>No

client

The StreamChat client object

import { StreamChat } from 'stream-chat';
import { Chat } from 'stream-chat-react-native';

const client = StreamChat.getInstance('api_key);
await client.connectUser('user_id', 'userToken');

<Chat client={client}>
</Chat>
TypeRequired
StreamChatNo

Message - A high level component which implements all the logic required for a message. The actual rendering of the message is delegated via the "Message" property

channel

Instance of channel object from stream-chat package.

Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript

import { StreamChat, Channel } from 'stream-chat';
import { Chat, Channel} from 'stream-chat-react-native';

const client = StreamChat.getInstance('api_key');
await client.connectUser('user_id', 'user_token');
const channel = client.channel('messaging', 'channel_id');
await channel.watch();

<Chat client={client}>
 <Channel channel={channel}>
 </Channel>
</Chat>
TypeRequired
ChannelNo

disabled

TypeRequired
booleanNo

enforceUniqueReaction

When set to true, reactions will be limited to 1 per user. If user selects another reaction then his previous reaction will be removed and replaced with new one.

This is similar to reaction UX on iMessage application.

TypeRequired
booleanNo

isAdmin

Returns true if the current user has admin privileges

TypeRequired
booleanNo

isModerator

Returns true if the current user is a moderator

TypeRequired
booleanNo

isOwner

Returns true if the current user is a owner

TypeRequired
booleanNo

members

{
  "thierry-123": {
    "id": "thierry-123",
    "role": "user",
    "created_at": "2019-04-03T14:42:47.087869Z",
    "updated_at": "2019-04-16T09:20:03.982283Z",
    "last_active": "2019-04-16T11:23:51.168113408+02:00",
    "online": true
  },
  "vishal-123": {
    "id": "vishal-123",
    "role": "user",
    "created_at": "2019-05-03T14:42:47.087869Z",
    "updated_at": "2019-05-16T09:20:03.982283Z",
    "last_active": "2019-06-16T11:23:51.168113408+02:00",
    "online": false
  }
}
TypeRequired
Record<string, ChannelMemberResponse<Us>>No

readEventsEnabled

TypeRequired
booleanNo

client

The StreamChat client object

import { StreamChat } from 'stream-chat';
import { Chat } from 'stream-chat-react-native';

const client = StreamChat.getInstance('api_key);
await client.connectUser('user_id', 'userToken');

<Chat client={client}>
</Chat>
TypeRequired
StreamChatNo

dismissKeyboard

TypeRequired
(() => void)No

actionsEnabled

Whether or not actions can be performed on message

TypeRequired
booleanNo

alignment

Position of the message, either 'right' or 'left'

TypeRequired
"right" | "left"No

canModifyMessage

Function that returns a boolean indicating whether or not the user can edit/delete the message.

TypeRequired
booleanNo

files

The files attached to a message

TypeRequired
Attachment<At>[]No

handleAction

Handler for actions. Actions in combination with attachments can be used to build commands.

TypeRequired
ActionHandlerNo

handleDeleteMessage

TypeRequired
(() => Promise<void>)No

handleEditMessage

TypeRequired
(() => void)No

handleReplyMessage

TypeRequired
(() => void)No

handleResendMessage

TypeRequired
(() => Promise<void>)No

handleToggleBanUser

TypeRequired
(() => Promise<void>)No

handleToggleMuteUser

TypeRequired
(() => Promise<void>)No

handleToggleReaction

TypeRequired
((reactionType: string) => Promise<void>)No

hasReactions

Whether or not message has reactions

TypeRequired
booleanNo

images

The images attached to a message

TypeRequired
Attachment<At>[]No

isMyMessage

Whether or not this is the active user's message

TypeRequired
booleanNo

lastGroupMessage

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

TypeRequired
booleanNo

messageContentOrder

Order to render the message content

TypeRequired
MessageContentType[]No

onLongPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we show the overlay with all the message actions on long press.

Arguments
event Event object for onLongPress event
message Message object which was long pressed
event Event object for onLongPress event
TypeRequired
(((payload: TouchableHandlerPayload) => void) & ((payload: Partial<MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>>) => void))No

onlyEmojis

Whether the message is only text and the text is only emojis

TypeRequired
booleanNo

onOpenThread

Handler to open a thread on a message

TypeRequired
(() => void)No

onPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we will dismiss the keyboard on press.

Arguments
event Event object for onPress event
message Message object which was long pressed
event Event object for onLongPress event
TypeRequired
(((payload: TouchableHandlerPayload) => void) & ((payload: Partial<MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>>) => void))No

onPressIn

TypeRequired
(((payload: TouchableHandlerPayload) => void) & ((payload: Partial<MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>>) => void))No

otherAttachments

The images attached to a message

TypeRequired
Attachment<At>[]No

reactions

TypeRequired
ReactionsNo

showMessageOverlay

TypeRequired
((messageReactions?: boolean) => void) | undefinedNo

showMessageStatus

TypeRequired
booleanNo

threadList

Whether or not the Message is part of a Thread

TypeRequired
booleanNo

lastReceivedId

Latest message id on current channel

TypeRequired
stringNo

preventPress

Prevent message being pressed for image viewer view

TypeRequired
booleanNo

showAvatar

Whether or not the avatar show show next to Message

TypeRequired
booleanNo

animatedLongPress

When false, pop-out animation will be disabled for message bubble, onLongPress

TypeRequired
booleanNo

blockUser

Full override of the block user button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

copyMessage

Full override of the copy message button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

deleteMessage

Full override of the delete message button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

dismissKeyboardOnMessageTouch

Should keyboard be dismissed when messaged is touched

TypeRequired
booleanNo

editMessage

Full override of the edit message button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

flagMessage

Full override of the flag message button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

forceAlignMessages

Whether messages should be aligned to right or left part of screen. By default, messages will be received messages will be aligned to left and sent messages will be aligned to right.

TypeRequired
boolean | "right" | "left"No

handleBlock

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleCopy

Handler to access when a copy message action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleDelete

Handler to access when a delete message action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleEdit

Handler to access when an edit message action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void)No

handleFlag

Handler to access when a flag message action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleMute

Handler to access when a mute user action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleReaction

Handler to process a reaction

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>, reactionType: string) => Promise<void>)No

handleReply

Handler to access when a reply action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleRetry

Handler to access when a retry action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

handleThreadReply

Handler to access when a thread reply action is invoked

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => Promise<void>)No

messageActions

Use this prop to override message actions (which pop-up in message overlay).

You can either completely override the default messageActions object.

<Channel
  messageActions=[
    {
      action: () => { someAction() };
      title: "Pin Message";
      icon: PinIcon;
      titleStyle: {};
    },
    {
      action: () => { someAction() };
      title: "Delete Message";
      icon: PinIcon;
      titleStyle: {};
    }
  ]
>
</Channel>

Or you can selectly keep certain action and remove some:

e.g. Lets say you only want to keep threadReply and copyMessage actions

<Channel
  messageActions={({
    blockUser,
    copyMessage,
    deleteMessage,
    editMessage,
    flagMessage,
    muteUser,
    reply,
    retry,
    threadReply,
  }) => ([
    threadReply, copyMessage
  ])}
>
 </Channel>
TypeRequired
Function | Array<Objects>No

MessageSimple

UI component for MessageSimple Defaults to: MessageSimple

TypeRequired
Component, elementNo

muteUser

Full override of the mute user button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

onDoubleTapMessage

Add double tap handler for message.

<Channel
 onDoubleTapMessage={({
   actionHandlers: {
       deleteMessage, // () => Promise<void>;
       editMessage, // () => void;
       reply, // () => void;
       resendMessage, // () => Promise<void>;
       showMessageOverlay, // () => void;
       toggleBanUser, // () => Promise<void>;
       toggleMuteUser, // () => Promise<void>;
       toggleReaction, // (reactionType: string) => Promise<void>;
   },
   message // message object on which longPress occured
 }) => {
   // Your custom action
 }}
/>
TypeRequired
((payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void)No

onLongPressMessage

Override default handler for onLongPress on message. You have access to payload of that handler as param:

<Channel
 onLongPressMessage={({
   actionHandlers: {
       deleteMessage, // () => Promise<void>;
       editMessage, // () => void;
       reply, // () => void;
       resendMessage, // () => Promise<void>;
       showMessageOverlay, // () => void;
       toggleBanUser, // () => Promise<void>;
       toggleMuteUser, // () => Promise<void>;
       toggleReaction, // (reactionType: string) => Promise<void>;
   },
   defaultHandler, // () => void
   event, // any event object corresponding to touchable feedback
   emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc
   message // message object on which longPress occured
 }) => {
   // Your custom action
 }}
/>
TypeRequired
((payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void)No

onPressInMessage

Add onPressIn handler for attachments. You have access to payload of that handler as param:

<Channel
 onPressInMessage={({
   actionHandlers: {
       deleteMessage, // () => Promise<void>;
       editMessage, // () => void;
       reply, // () => void;
       resendMessage, // () => Promise<void>;
       showMessageOverlay, // () => void;
       toggleBanUser, // () => Promise<void>;
       toggleMuteUser, // () => Promise<void>;
       toggleReaction, // (reactionType: string) => Promise<void>;
   },
   defaultHandler, // () => void
   event, // any event object corresponding to touchable feedback
   emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc
   message // message object on which longPress occured
 }) => {
   // Your custom action
 }}
/>
TypeRequired
((payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void)No

onPressMessage

Override onPress handler for message. You have access to payload of that handler as param:

<Channel
 onPressMessage={({
   actionHandlers: {
       deleteMessage, // () => Promise<void>;
       editMessage, // () => void;
       reply, // () => void;
       resendMessage, // () => Promise<void>;
       showMessageOverlay, // () => void;
       toggleBanUser, // () => Promise<void>;
       toggleMuteUser, // () => Promise<void>;
       toggleReaction, // (reactionType: string) => Promise<void>;
   },
   defaultHandler, // () => void
   event, // any event object corresponding to touchable feedback
   emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc
   message // message object on which longPress occured
 }) => {
   // Your custom action
 }}
/>
TypeRequired
((payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void)No

OverlayReactionList

UI component for OverlayReactionList

TypeRequired
Component, elementNo

reactionsEnabled

TypeRequired
booleanNo

removeMessage

TypeRequired
((message: { id: string; parent_id?: string; }) => void) | undefinedNo

repliesEnabled

TypeRequired
booleanNo

reply

Full override of the reply button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

retry

Full override of the resend button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction) | nullNo

retrySendMessage

Override the api request for retry message functionality.

TypeRequired
((message: MessageResponse<At, Ch, Co, Me, Re, Us>) => Promise<void>)No

selectReaction

Full override of the reaction function on Message and Message Overlay

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => (reactionType: string) => Promise<void>)No

setEditingState

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void)No

setQuotedMessageState

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void)No

supportedReactions

TypeRequired
ReactionData[]No

threadReply

Full override of the thread reply button in the Message Actions

Please check cookbook for details.

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => MessageAction)No

updateMessage

TypeRequired
((updatedMessage: MessageResponse<At, Ch, Co, Me, Re, Us>, extraState?: { commands?: CommandResponse<Co>[]; messageInput?: string | undefined; threadMessages?: FormatMessageResponse<...>[] | undefined; } | undefined) => void) | undefinedNo

setData

TypeRequired
Dispatch<SetStateAction<MessageOverlayData<At, Ch, Co, Ev, Me, Re, Us>>>No

setOverlay

TypeRequired
Dispatch<SetStateAction<Overlay>>No

openThread

TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void)No

t

TypeRequired
TFunction | ((key: string) => string)No

messagesContext

TypeRequired
MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>No

enableLongPress

Whether or not users are able to long press messages.

TypeRequired
booleanNo

goToMessage

TypeRequired
((messageId: string) => void)No

onThreadSelect

Handler to open the thread on message. This is callback for touch event for replies button.

Arguments
message A message object to open the thread upon.
TypeRequired
((message: MessageType<At, Ch, Co, Ev, Me, Re, Us>) => void)No

showUnreadUnderlay

TypeRequired
booleanNo

style

TypeRequired
StyleProp<ViewStyle>No

targetedMessage

TypeRequired
booleanNo

groupStyles

Position of message in group - top, bottom, middle, single.

Message group is a group of consecutive messages from same user. groupStyles can be used to style message as per their position in message group e.g., user avatar (to which message belongs to) is only showed for last (bottom) message in group.

TypeRequired
GroupType[]No

message

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "channel" | "attachments" | "text" | "id" | "html" | "mml" | "parent_id" | "pinned" | ... 22 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

The Message component is the high level component that deals with all the message logic. It doesn't implement any rendering, but delegates that to the Message prop.

The Message component provides the following functions to the rendered component:

  • isMyMessage returns true if message belongs to current user, else false

    Params

    • message
  • isAdmin returns true if current user has admin role.

  • canEditMessage returns true if current user has permission to edit message.

  • canDeleteMessage returns true if current user has permission to edit message.

  • handleFlag Handler to flag a message

  • handleMute Handler to mute a user of message

  • handleEdit Handler to edit a message This message simply sets current message as value of editing property of channel context. editing prop is then used by MessageInput component to switch to edit mode.

  • handleDelete Handler to delete a message

  • handleReaction Handler to add/remove reaction on message

  • handleAction Handler for actions. Actions in combination with attachments can be used to build commands.

  • handleRetry Handler to resend the message, in case of failure.

  • openThread Handler to open the thread on current message.

Message UI component

channel

Instance of channel object from stream-chat package.

Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript

import { StreamChat, Channel } from 'stream-chat';
import { Chat, Channel} from 'stream-chat-react-native';

const client = StreamChat.getInstance('api_key');
await client.connectUser('user_id', 'user_token');
const channel = client.channel('messaging', 'channel_id');
await channel.watch();

<Chat client={client}>
 <Channel channel={channel}>
 </Channel>
</Chat>
TypeRequired
ChannelNo

alignment

Position of the message, either 'right' or 'left'

TypeRequired
"right" | "left"No

groupStyles

Position of message in group - top, bottom, middle, single.

Message group is a group of consecutive messages from same user. groupStyles can be used to style message as per their position in message group e.g., user avatar (to which message belongs to) is only showed for last (bottom) message in group.

TypeRequired
GroupType[]No

hasReactions

Whether or not message has reactions

TypeRequired
booleanNo

message

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "channel" | "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 22 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

MessageAvatar

UI component for MessageAvatar Defaults to: MessageAvatar

TypeRequired
Component, elementNo

MessageContent

UI component for MessageContent Defaults to: MessageContent

TypeRequired
Component, elementNo

ReactionList

UI component for ReactionList Defaults to: ReactionList

TypeRequired
Component, elementNo

alignment

Position of the message, either 'right' or 'left'

TypeRequired
"right" | "left"No

lastGroupMessage

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

TypeRequired
booleanNo

message

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "channel" | "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 22 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

showAvatar

Whether or not the avatar show show next to Message

TypeRequired
booleanNo

size

size in pixels

TypeRequired
numberNo

Child of MessageSimple that displays a message's content

disabled

TypeRequired
booleanNo

members

{
  "thierry-123": {
    "id": "thierry-123",
    "role": "user",
    "created_at": "2019-04-03T14:42:47.087869Z",
    "updated_at": "2019-04-16T09:20:03.982283Z",
    "last_active": "2019-04-16T11:23:51.168113408+02:00",
    "online": true
  },
  "vishal-123": {
    "id": "vishal-123",
    "role": "user",
    "created_at": "2019-05-03T14:42:47.087869Z",
    "updated_at": "2019-05-16T09:20:03.982283Z",
    "last_active": "2019-06-16T11:23:51.168113408+02:00",
    "online": false
  }
}
TypeRequired
Record<string, ChannelMemberResponse<Us>>No

alignment

Position of the message, either 'right' or 'left'

TypeRequired
"right" | "left"No

groupStyles

Position of message in group - top, bottom, middle, single.

Message group is a group of consecutive messages from same user. groupStyles can be used to style message as per their position in message group e.g., user avatar (to which message belongs to) is only showed for last (bottom) message in group.

TypeRequired
GroupType[]No

hasReactions

Whether or not message has reactions

TypeRequired
booleanNo

isMyMessage

Whether or not this is the active user's message

TypeRequired
booleanNo

lastGroupMessage

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

TypeRequired
booleanNo

message

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "channel" | "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 22 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

messageContentOrder

Order to render the message content

TypeRequired
MessageContentType[]No

onLongPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we show the overlay with all the message actions on long press.

Arguments
event Event object for onLongPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onlyEmojis

Whether the message is only text and the text is only emojis

TypeRequired
booleanNo

onPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we will dismiss the keyboard on press.

Arguments
event Event object for onPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onPressIn

TypeRequired
((payload: TouchableHandlerPayload) => void) | nullNo

otherAttachments

The images attached to a message

TypeRequired
Attachment<At>[]No

preventPress

Prevent message being pressed for image viewer view

TypeRequired
booleanNo

showMessageStatus

TypeRequired
booleanNo

threadList

Whether or not the Message is part of a Thread

TypeRequired
booleanNo

additionalTouchableProps

Provide any additional props for TouchableOpacity which wraps inner MessageContent component here. Please check docs for TouchableOpacity for supported props - https://reactnative.dev/docs/touchableopacity#props

TypeRequired
ObjectNo

Attachment

UI component for Attachment. Defaults to: Attachment

TypeRequired
Component, elementNo

FileAttachmentGroup

UI component to display group of File type attachments or multiple file attachments (in single message). Defaults to: FileAttachmentGroup

TypeRequired
Component, elementNo

formatDate

Optional function to custom format the message date

TypeRequired
((date: TDateTimeParserInput) => string)No

Gallery

UI component to display image attachments Defaults to: Gallery

TypeRequired
Component, elementNo

MessageFooter

Custom message footer component

TypeRequired
Component, elementNo

MessageHeader

Custom message header component

TypeRequired
Component, elementNo

MessageReplies

UI component for MessageReplies Defaults to: MessageReplies

TypeRequired
Component, elementNo

MessageStatus

UI component for MessageStatus (delivered/read) Defaults to: MessageStatus

TypeRequired
Component, elementNo

onPressInMessage

Add onPressIn handler for attachments. You have access to payload of that handler as param:

<Channel
 onPressInMessage={({
   actionHandlers: {
       deleteMessage, // () => Promise<void>;
       editMessage, // () => void;
       reply, // () => void;
       resendMessage, // () => Promise<void>;
       showMessageOverlay, // () => void;
       toggleBanUser, // () => Promise<void>;
       toggleMuteUser, // () => Promise<void>;
       toggleReaction, // (reactionType: string) => Promise<void>;
   },
   defaultHandler, // () => void
   event, // any event object corresponding to touchable feedback
   emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc
   message // message object on which longPress occured
 }) => {
   // Your custom action
 }}
/>
TypeRequired
((payload: MessageTouchableHandlerPayload<At, Ch, Co, Ev, Me, Re, Us>) => void)No

repliesEnabled

TypeRequired
booleanNo

Reply

UI component for Reply Defaults to: Reply

TypeRequired
Component, elementNo

t

TypeRequired
TFunction | ((key: string) => string)No

tDateTimeParser

TypeRequired
TDateTimeParserNo

setMessageContentWidth

TypeRequired
Dispatch<SetStateAction<number>>No

alignment

Position of the message, either 'right' or 'left'

TypeRequired
"right" | "left"No

message

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "channel" | "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 22 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

onLongPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we show the overlay with all the message actions on long press.

Arguments
event Event object for onLongPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we will dismiss the keyboard on press.

Arguments
event Event object for onPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onOpenThread

Handler to open a thread on a message

TypeRequired
(() => void)No

threadList

Whether or not the Message is part of a Thread

TypeRequired
booleanNo

MessageRepliesAvatars

UI Component for MessageRepliesAvatars Defaults to: MessageRepliesAvatars

TypeRequired
Component, elementNo

t

TypeRequired
TFunction | ((key: string) => string)No

noBorder

TypeRequired
booleanNo

repliesCurveColor

TypeRequired
string | unique symbolNo

readEventsEnabled

TypeRequired
booleanNo

message

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "channel" | "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 22 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

threadList

Whether or not the Message is part of a Thread

TypeRequired
booleanNo

message

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "channel" | "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 22 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

onLongPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we show the overlay with all the message actions on long press.

Arguments
event Event object for onLongPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

onlyEmojis

Whether the message is only text and the text is only emojis

TypeRequired
booleanNo

onPress

You can call methods available on the Message component such as handleEdit, handleDelete, handleAction etc.

Source - Message

By default, we will dismiss the keyboard on press.

Arguments
event Event object for onPress event
TypeRequired
((payload: TouchableHandlerPayload) => void)No

markdownRules

Object specifying rules defined within simple-markdown https://github.com/Khan/simple-markdown#adding-a-simple-extension

TypeRequired
Partial<DefaultRules>No

MessageText

Custom UI component for message text

TypeRequired
Component, elementNo

markdownStyles

TypeRequired
Partial<{ autolink: TextStyle; blockQuoteBar: ViewStyle; blockQuoteSection: ViewStyle; blockQuoteSectionBar: ViewStyle; blockQuoteText: ViewStyle | TextStyle; ... 37 more ...; view: ViewStyle; }>No

styles

TypeRequired
Partial<{ textContainer: StyleProp<ViewStyle>; }>No

MessageOverlay - A high level component which implements all the logic required for a message overlay

MessageActions

Custom UI component for rendering message actions in overlay.

Default MessageActions

TypeRequired
Component, elementNo

OverlayReactionList

Custom UI component for rendering reaction selector in overlay (which shows up on long press on message).

Default OverlayReactionList

TypeRequired
Component, elementNo

OverlayReactions

Custom UI component for rendering reactions list, in overlay (which shows up on long press on message).

Default OverlayReactions

TypeRequired
Component, elementNo

reset

TypeRequired
(() => void)No

alignment

TypeRequired
"right" | "left"No

clientId

TypeRequired
stringNo

files

TypeRequired
Attachment<At>[]No

groupStyles

TypeRequired
GroupType[]No

handleReaction

TypeRequired
((reactionType: string) => Promise<void>)No

images

TypeRequired
Attachment<At>[]No

message

TypeRequired
(Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 23 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

messageActions

TypeRequired
MessageAction[]No

messageReactionTitle

TypeRequired
stringNo

messagesContext

TypeRequired
MessagesContextValue<At, Ch, Co, Ev, Me, Re, Us>No

onlyEmojis

TypeRequired
booleanNo

otherAttachments

TypeRequired
Attachment<At>[]No

threadList

TypeRequired
booleanNo

overlay

TypeRequired
"message" | "alert" | "gallery" | "none"No

setOverlay

TypeRequired
Dispatch<SetStateAction<Overlay>>No

visible

TypeRequired
booleanNo

overlayOpacity

TypeRequired
SharedValue<number>No

MessageActions - A high level component which implements all the logic required for MessageActions

alignment

TypeRequired
"right" | "left"No

messageActions

TypeRequired
MessageAction[]No

showScreen

TypeRequired
SharedValue<number>No

handleReaction

TypeRequired
((reactionType: string) => Promise<void>)No

setOverlay

TypeRequired
Dispatch<SetStateAction<Overlay>>No

ownReactionTypes

TypeRequired
string[]No

Icon

TypeRequired
Component, elementNo

index

TypeRequired
numberNo

numberOfReactions

TypeRequired
numberNo

showScreen

TypeRequired
SharedValue<number>No

type

TypeRequired
stringNo

OverlayReactions - A high level component which implements all the logic required for message overlay reactions

reactions

TypeRequired
Reaction[]No

showScreen

TypeRequired
SharedValue<number>No

title

TypeRequired
stringNo

alignment

TypeRequired
"right" | "left"No

supportedReactions

TypeRequired
ReactionData[]No

UI Component for message input It's a consumer of Channel Context, Chat Context, MessageInput Context, Suggestions Context, and Translation Context

disabled

TypeRequired
booleanNo

members

{
  "thierry-123": {
    "id": "thierry-123",
    "role": "user",
    "created_at": "2019-04-03T14:42:47.087869Z",
    "updated_at": "2019-04-16T09:20:03.982283Z",
    "last_active": "2019-04-16T11:23:51.168113408+02:00",
    "online": true
  },
  "vishal-123": {
    "id": "vishal-123",
    "role": "user",
    "created_at": "2019-05-03T14:42:47.087869Z",
    "updated_at": "2019-05-16T09:20:03.982283Z",
    "last_active": "2019-06-16T11:23:51.168113408+02:00",
    "online": false
  }
}
TypeRequired
Record<string, ChannelMemberResponse<Us>>No

watchers

{
  "thierry-123": {
    "id": "thierry-123",
    "role": "user",
    "created_at": "2019-04-03T14:42:47.087869Z",
    "updated_at": "2019-04-16T09:20:03.982283Z",
    "last_active": "2019-04-16T11:23:51.168113408+02:00",
    "online": true
  },
  "vishal-123": {
    "id": "vishal-123",
    "role": "user",
    "created_at": "2019-05-03T14:42:47.087869Z",
    "updated_at": "2019-05-16T09:20:03.982283Z",
    "last_active": "2019-06-16T11:23:51.168113408+02:00",
    "online": false
  }
}
TypeRequired
Record<string, UserResponse<Us>>No

clearEditingState

TypeRequired
(() => void)No

clearQuotedMessageState

TypeRequired
(() => void)No

editing

TypeRequired
boolean | (Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 23 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

FileUploadPreview

Custom UI component for FileUploadPreview. Defaults to and accepts same props as: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageInput/FileUploadPreview.tsx

TypeRequired
Component, elementNo

ImageUploadPreview

Custom UI component for ImageUploadPreview. Defaults to and accepts same props as: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/MessageInput/ImageUploadPreview.tsx

TypeRequired
Component, elementNo

maxNumberOfFiles

Limit on allowed number of files to attach at a time.

TypeRequired
numberNo

quotedMessage

TypeRequired
boolean | (Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 23 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

SendButton

Custom UI component for send button.

Defaults to and accepts same props as: SendButton

TypeRequired
Component, elementNo

ShowThreadMessageInChannelButton

Custom UI component to render checkbox with text ("Also send to channel") in Thread's input box. When ticked, message will also be sent in parent channel.

TypeRequired
Component, elementNo

additionalTextInputProps

Additional props for underlying TextInput component. These props will be forwarded as it is to TextInput component.

See https://reactnative.dev/docs/textinput#reference

TypeRequired
TextInputPropsNo

Input

Custom UI component for AutoCompleteInput. Has access to all of MessageInputContext

TypeRequired
Component, elementNo

InputButtons

Custom UI component to override buttons on left side of input box Defaults to InputButtons, which contain following components/buttons:

  • AttachButton
  • CommandsButtom

You have access to following prop functions:

  • closeAttachmentPicker
  • openAttachmentPicker
  • openCommandsPicker
  • toggleAttachmentPicker
TypeRequired
Component, elementNo

asyncIds

TypeRequired
string[]No

asyncUploads

TypeRequired
{ [key: string]: { state: string; url: string; }; }No

closeAttachmentPicker

TypeRequired
(() => void)No

fileUploads

An array of file objects which are set for upload. It has the following structure:

 [
   {
     "file": // File object,
     "id": "randomly_generated_temp_id_1",
     "state": "uploading" // or "finished",
     "url": "https://url1.com",
   },
   {
     "file": // File object,
     "id": "randomly_generated_temp_id_2",
     "state": "uploading" // or "finished",
     "url": "https://url1.com",
   },
 ]
TypeRequired
FileUpload[]No

giphyActive

TypeRequired
booleanNo

imageUploads

An array of image objects which are set for upload. It has the following structure:

 [
   {
     "file": // File object,
     "id": "randomly_generated_temp_id_1",
     "state": "uploading" // or "finished",
   },
   {
     "file": // File object,
     "id": "randomly_generated_temp_id_2",
     "state": "uploading" // or "finished",
   },
 ]
TypeRequired
ImageUpload[]No

inputBoxRef

TypeRequired
MutableRefObject<TextInput | null>No

isValidMessage

TypeRequired
(() => boolean)No

mentionedUsers

TypeRequired
string[]No

numberOfUploads

TypeRequired
numberNo

resetInput

TypeRequired
((pendingAttachments?: Attachment<At>[]) => void) | undefinedNo

sending

TypeRequired
MutableRefObject<boolean>No

sendMessageAsync

TypeRequired
((id: string) => void)No

setGiphyActive

TypeRequired
Dispatch<SetStateAction<boolean>>No

showMoreOptions

TypeRequired
booleanNo

removeImage

Function for removing an image from the upload preview

Arguments
id string ID of image in imageUploads object in state of MessageInput
TypeRequired
((id: string) => void)No

uploadNewImage

TypeRequired
((image: Partial<Asset>) => Promise<void>)No

Reply

UI component for Reply Defaults to: Reply

TypeRequired
Component, elementNo

componentType

TypeRequired
string | ReactElement<{ item: Suggestion<Co, Us>; }, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<...>)>No

suggestions

TypeRequired
Suggestions<Co, Us>No

suggestionsTitle

TypeRequired
ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>No

t

TypeRequired
TFunction | ((key: string) => string)No

threadList

TypeRequired
booleanNo

UI Component for attach button in MessageInput component.

disabled

TypeRequired
booleanNo

handleOnPress

Function that opens attachment options bottom sheet

TypeRequired
((event: GestureResponderEvent) => void)No

selectedPicker

TypeRequired
"images"No

UI Component for attach button in MessageInput component.

disabled

TypeRequired
booleanNo

suggestions

TypeRequired
Suggestions<Co, Us>No

handleOnPress

Function that opens commands selector

TypeRequired
((event: GestureResponderEvent) => void)No

UI Component to preview the images set for upload

imageUploads

An array of image objects which are set for upload. It has the following structure:

 [
   {
     "file": // File object,
     "id": "randomly_generated_temp_id_1",
     "state": "uploading" // or "finished",
   },
   {
     "file": // File object,
     "id": "randomly_generated_temp_id_2",
     "state": "uploading" // or "finished",
   },
 ]
TypeRequired
ImageUpload[]No

removeImage

Function for removing an image from the upload preview

Arguments
id string ID of image in imageUploads object in state of MessageInput
TypeRequired
((id: string) => void)No

uploadImage

Function for attempting to upload an image

TypeRequired
(({ newImage }: { newImage: ImageUpload; }) => Promise<void>)No

UI Component for more options button in MessageInput component.

disabled

TypeRequired
booleanNo

handleOnPress

Function that opens attachment options bottom sheet

TypeRequired
((event: GestureResponderEvent) => void)No

UI Component for send button in MessageInput component.

sendMessage

TypeRequired
(() => Promise<void>)No

giphyActive

TypeRequired
booleanNo

disabled

Disables the button

TypeRequired
booleanNo

sendThreadMessageInChannel

TypeRequired
booleanNo

setSendThreadMessageInChannel

TypeRequired
Dispatch<SetStateAction<boolean>>No

allowThreadMessagesInChannel

TypeRequired
booleanNo

t

TypeRequired
TFunction | ((key: string) => string)No

threadList

TypeRequired
booleanNo

action

Action triggered when clicked indicator

TypeRequired
((event: GestureResponderEvent) => void)No

active

Boolean status of upload progress

TypeRequired
booleanNo

style

style

TypeRequired
StyleProp<ViewStyle>No

type

Type of active indicator

TypeRequired
"in_progress" | "retry"No

UI Component for reply

quotedMessage

TypeRequired
boolean | (Pick<MessageResponse<At, Ch, Co, {}, Re, Us>, "id" | "attachments" | "html" | "mml" | "parent_id" | "pinned" | "quoted_message_id" | ... 23 more ... | "type"> & Record<...> & { ...; }) | (Record<...> & ... 2 more ... & { ...; })No

FileAttachmentIcon

UI component for attachment icon for type 'file' attachment. Defaults to: https://github.com/GetStream/stream-chat-react-native/blob/master/src/components/Attachment/FileIcon.tsx

TypeRequired
Component, elementNo

MessageAvatar

UI component for MessageAvatar Defaults to: MessageAvatar

TypeRequired
Component, elementNo

t

TypeRequired
TFunction | ((key: string) => string)No

attachmentSize

TypeRequired
numberNo

styles

TypeRequired
Partial<{ container: ViewStyle; fileAttachmentContainer: ViewStyle; imageAttachment: ImageStyle; messageContainer: ViewStyle; textContainer: ViewStyle; }>No

Wrapper around i18next class for Stream related translations.

API

  • constructor(options)

    Constructor accepts following options:

    • language (String) default: 'en'

      Language code e.g., en, tr

    • disableDateTimeTranslations (boolean) default: false

      Disable translations for datetimes

    • debug (boolean) default: false

      Enable debug mode in internal i18n class

    • logger (function) default: () => {}

      Logger function to log warnings/errors from this class

    • dayjsLocaleConfigForLanguage (object) default: 'enConfig'

      Config object for internal dayjs object, corresponding to language (param)

    • DateTimeParser (function)

      Moment or Dayjs instance/function.

  • geti18Instance

    Returns an instance of i18next used internally.

  • getAvailableLanguages

    Returns all the languages (code) registered with Streami18n

  • getTranslations

    Returns all the translations registered with Streami18n

  • getTranslators

    Returns an object containing t (i18next translator) and momentjs instance (configured with set language)

    const streami18n = new Streami18n({ language: 'nl' });
    const { t, tDateTimeParser } = await streami18n.getTranslators();
  • registerTranslation

    params

    • language | string
    • translator | object
    • customDayjsLocale | object (optional)
      streami18n.registerTranslation(
        'mr',
        {
          'Nothing yet...': 'काहीही नाही  ...',
          '{{ firstUser }} and {{ secondUser }} are typing...':
              '{{ firstUser }} आणि {{ secondUser }} टीपी करत आहेत ',
        },
        {
          months: [...],
          monthsShort: [...],
          calendar: {
              sameDay: '...'
          }
        }
      );
  • setLanguage

    Set a different language

    streami18n.setLanguage('tr');

Instance of this class should be provided to Chat component to handle translations. Stream provides following list of in-built translations:

  1. English (en)
  2. Dutch (nl)
  3. Russian (ru)
  4. Turkish (tr)
  5. French (fr)
  6. Italian (it)
  7. Hindi (hi)

Docs

  • Text translations

    Simplest way to start using chat components in one of the in-built languages would be following:

    const i18n = new Streami18n({ language: 'nl' });
    <Chat client={chatClient} i18nInstance={i18n}>
      ...
    </Chat>;

    If you would like to override certain keys in in-built translation. UI will be automatically updated in this case.

    const i18n = new Streami18n({
      language: 'nl',
      translationsForLanguage: {
        'Nothing yet...': 'Nog Niet ...',
        '{{ firstUser }} and {{ secondUser }} are typing...':
          '{{ firstUser }} en {{ secondUser }} zijn aan het typen...',
      },
    });

    If you would like to register additional languages, use registerTranslation. You can add as many languages as you want:

    i18n.registerTranslation('zh', {
      'Nothing yet...': 'Nog Niet ...',
      '{{ firstUser }} and {{ secondUser }} are typing...':
        '{{ firstUser }} en {{ secondUser }} zijn aan het typen...',
    });
    
    <Chat client={chatClient} i18nInstance={i18n}>
      ...
    </Chat>;

    You can use the same function to add whole new language as well.

    const i18n = new Streami18n();
    
    i18n.registerTranslation('mr', {
      'Nothing yet...': 'काहीही नाही  ...',
      '{{ firstUser }} and {{ secondUser }} are typing...':
        '{{ firstUser }} आणि {{ secondUser }} टीपी करत आहेत ',
    });
    
    // Make sure to call setLanguage to reflect new language in UI.
    i18n.setLanguage('it');
    
    <Chat client={chatClient} i18nInstance={i18n}>
      ...
    </Chat>;

    We have exported all the in-built translations in our library. You can import them in your project as following:

    import {
      enTranslations,
      nlTranslations,
      ruTranslations,
      trTranslations,
      frTranslations,
      hiTranslations,
      itTranslations,
      esTranslations,
    } from 'stream-chat-react-native'; // or 'stream-chat-expo'

    If you would like to maintain your own translation files:

    1. Create a json file in your project with whatever name you prefer. Best practice would be to name it after the language-translations it contains e.g, If you are creating a translation file for Korean language then ko.json
    2. Copy the content of file https://github.com/GetStream/stream-chat-react/blob/master/src/i18n/en.json
    3. Change the values of the keys as translation of key.
    4. Use it in chat client:
    import koTranslation from 'path/to/ko.json';
    import deTranslation from 'path/to/de.json';
    const i18n = new Streami18n();
    i18n.registerTranslation('ko', koTranslation);
    i18n.registerTranslation('de', deTranslation);
    // You can switch language at any point in lifetime of component, it will automatically reflect in UI.
    i18n.setLanguage('ko');
    <Chat client={chatClient} i18nInstance={i18n}>
      ...
    </Chat>;

Datetime translations

Stream react chat components uses dayjs internally by default to format datetime stamp. e.g., in ChannelPreview, MessageContent components. Dayjs has locale support as well - https://day.js.org/docs/en/i18n/i18n Dayjs is a lightweight alternative to Momentjs with the same modern API.

Dayjs provides locale config for plenty of languages, you can check the whole list of locale configs at following url https://github.com/iamkun/dayjs/tree/dev/src/locale

You can either provide the dayjs locale config while registering language with Streami18n (either via constructor or registerTranslation()) OR you can provide your own Dayjs or Moment instance to Streami18n constructor, which will be then used internally (using the language locale) in components.

Via language registration

e.g.,

const i18n = new Streami18n({
 language: 'nl',
 dayjsLocaleConfigForLanguage: {
   months: [...],
   monthsShort: [...],
   calendar: {
     sameDay: ...'
   }
 }
});

Similarly, you can add locale config for dayjs while registering translation via registerTranslation function.

e.g.,

const i18n = new Streami18n();

i18n.registerTranslation(
 'mr',
 {
   'Nothing yet...': 'काहीही नाही  ...',
   '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} आणि {{ secondUser }} टीपी करत आहेत ',
 },
 {
   months: [...],
   monthsShort: [...],
   calendar: {
     sameDay: ...'
   }
 }
);

Provide your own Moment object

import 'moment/locale/nl';
import 'moment/locale/it';
// or if you want to include all locales
import 'moment/min/locales';

import Moment from moment

const i18n = new Streami18n({
 language: 'nl',
 DateTimeParser: Moment
})

Provide your own Dayjs object

import Dayjs from 'dayjs';

import 'dayjs/locale/nl';
import 'dayjs/locale/it';

const i18n = new Streami18n({
  language: 'nl',
  DateTimeParser: Dayjs,
});

If you would like to stick with english language for datetimes in Stream components, you can set disableDateTimeTranslations to true.

NOTE Please note here that locales in dayjs/locale/it (and all other language locale files), does not load calendar related config like 'today at', 'tomorrow at' etc. You will need to manually configure calendar locale using updateLocale.

TIPS

  1. If you would like to stick with english language for datetimes in Stream components, you can set disableDateTimeTranslations to true.
const i18n = new Streami18n({
  language: 'nl',
  disableDateTimeTranslations: false,
});
  1. If you want to disable all the warnings, you can override logger option:
const i18n = new Streami18n({
  language: 'nl',
  logger: () => null,
});

The default en locale config from dayjs is as follow:

{
  "months": [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
  ],
  "monthsShort": [
    "Jan",
    "Feb",
    "Mar",
    "Apr",
    "May",
    "Jun",
    "Jul",
    "Aug",
    "Sep",
    "Oct",
    "Nov",
    "Dec"
  ],
  "week": {
    "dow": 0,
    "doy": 6
  },
  "weekdays": [
    "Sunday",
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday"
  ],
  "weekdaysMin": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  "weekdaysShort": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  "calendar": {
    "sameDay": "[Today at] LT",
    "nextDay": "[Tomorrow at] LT",
    "nextWeek": "dddd [at] LT",
    "lastDay": "[Yesterday at] LT",
    "lastWeek": "[Last] dddd [at] LT",
    "sameElse": "L"
  },
  "formats": {
    "LTS": "h:mm:ss A",
    "LT": "h:mm A",
    "L": "MM/DD/YYYY",
    "LL": "MMMM D, YYYY",
    "LLL": "MMMM D, YYYY h:mm A",
    "LLLL": "dddd, MMMM D, YYYY h:mm A"
  },
  "invalidDate": "Invalid date",
  "ordinal": "%d.",
  "dayOfMonthOrdinalParse": /\\d{1,2}(th|st|nd|rd)/,
  "relativeTime": {
    "future": "in %s",
    "past": "%s ago",
    "s": "a few seconds",
    "ss": "%d seconds",
    "m": "a minute",
    "mm": "%d minutes",
    "h": "an hour",
    "hh": "%d hours",
    "d": "a day",
    "dd": "%d days",
    "M": "a month",
    "MM": "%d months",
    "y": "a year",
    "yy": "%d years"
  },
  "meridiemParse": /[ap]\\.?m?\\.?/i,
  "abbr": "en"
}

Avatar - A round avatar image with fallback to user's initials

size

size in pixels

TypeRequired
numberNo

containerStyle

TypeRequired
StyleProp<ViewStyle>No

image

image url

TypeRequired
stringNo

imageStyle

name of the picture, used for fallback

TypeRequired
StyleProp<ImageStyle>No

name

TypeRequired
stringNo

online

TypeRequired
booleanNo

presenceIndicator

TypeRequired
CirclePropsNo

presenceIndicatorContainerStyle

TypeRequired
StyleProp<ViewStyle>No

testID

TypeRequired
stringNo

GroupAvatar - A round group of avatar images with fallbacks to users' initials

size

total size in pixels

TypeRequired
numberNo

containerStyle

TypeRequired
StyleProp<ViewStyle>No

images

image urls

TypeRequired
string[]No

names

name of the users, used for fallback

TypeRequired
string[]No

testID

TypeRequired
stringNo

Please check the ChatContextValue in ChatContext, for consumable values. Provider for this context exists in Chat component. And so, any child component of Chat can get access to context as following:

  • Functional component
import { useChatContext } from 'stream-chat-react-native';

const SomeChildComponent = () => {
  const { client, isOnline } = useChatContext();

  return (
    <View />
  )
}
  • Class component
import React from 'react';
import { withChatContext } from 'stream-chat-react-native';

class SomeChildComponent extends React.Component {
  constructor(props) {
    super(props);

    console.log(props.client);
    console.log(props.isOnline);
  }

  // UI Logic
}

export withChatContext(SomeChildComponent);

Please check the ChannelContextValue in ChannelContext, for consumable values. Provider for this context exists in Channel component. And so, any child component of Channel can get access to context as following:

  • Functional component
import { useChannelContext } from 'stream-chat-react-native';

const SomeChildComponent = () => {
  const { loading, reloadChannel } = useChannelContext();

  return (
    <View />
  )
}
  • Class component
import React from 'react';
import { withChannelContext } from 'stream-chat-react-native';

class SomeChildComponent extends React.Component {
  constructor(props) {
    super(props);

    console.log(props.loading);
    console.log(props.reloadChannel);
  }

  // UI Logic
}

export withChannelContext(SomeChildComponent);

Please check the ChannelsContextValue in ChannelsContext, for consumable values. Provider for this context exists in ChannelList component. And so, any child component of ChannelList can get access to context as following:

  • Functional component
import { useChannelsContext } from 'stream-chat-react-native';

const SomeChildComponent = () => {
  const { error, loadingChannels, refreshing } = useChannelsContext();

  return (
    <View />
  )
}
  • Class component
import React from 'react';
import { withChannelsContext } from 'stream-chat-react-native';

class SomeChildComponent extends React.Component {
  constructor(props) {
    super(props);

    console.log(props.error);
    console.log(props.loadingChannels);
    console.log(props.refreshing);
  }

  // UI Logic
}

export withChannelsContext(SomeChildComponent);

Please check the ImageGalleryContextValue in ImageGalleryContext, for consumable values. Provider for this context exists in OverlayProvider component. And so, any child component of OverlayProvider can get access to context as following:

  • Functional component
import { useChannelsContext } from 'stream-chat-react-native';

const SomeChildComponent = () => {
  const { image, setImage, setImages } = useImageGalleryContext();

  return (
    <View />
  )
}
  • Class component
import React from 'react';
import { withChannelsContext } from 'stream-chat-react-native';

class SomeChildComponent extends React.Component {
  constructor(props) {
    super(props);

    console.log(props.image);
    console.log(props.setImage);
    console.log(props.setImages);
  }

  // UI Logic
}

export withImageGalleryContext(SomeChildComponent);

Please check the MessageContextValue in MessageContext, for consumable values. Provider for this context exists in Message component. And so, any child component of Message can get access to context as following:

  • Functional component
import { useMessageContext } from 'stream-chat-react-native';

const SomeChildComponent = () => {
  const {
    handleDeleteMessage,
    handleEditMessage,
    handleReplyMessage,
    handleResendMessage,
    handleToggleBanUser,
    handleToggleMuteUser,
    handleToggleReaction,
  } = useMessageContext();

  return (
    <View />
  )
}
  • Class component
import React from 'react';
import { withMessageContext } from 'stream-chat-react-native';

class SomeChildComponent extends React.Component {
  constructor(props) {
    super(props);

    console.log(props.handleDeleteMessage);
    console.log(props.handleEditMessage);
    console.log(props.handleToggleReaction);
  }

  // UI Logic
}

Please check the MessageInputContextValue in MessageInputContext, for consumable values. Provider for this context exists in Channel component. And so, any child component of Channel can get access to context as following:

  • Functional component
import { useMessageInputContext } from 'stream-chat-react-native';

const SomeChildComponent = () => {
  const {
    openAttachmentPicker,
    openCommandsPicker,
    openFilePicker,
    openMentionsPicker,
  } = useMessageInputContext();

  return (
    <View />
  )
}
  • Class component
import React from 'react';
import { withMessageInputContext } from 'stream-chat-react-native';

class SomeChildComponent extends React.Component {
  constructor(props) {
    super(props);

    console.log(props.openAttachmentPicker);
    console.log(props.openCommandsPicker);
    console.log(props.openFilePicker);
  }

  // UI Logic
}

Please check the MessagesContextValue in MessagesContext, for consumable values. Provider for this context exists in Channel component. And so, any child component of Channel can get access to context as following:

  • Functional component
import { useMessagesContext } from 'stream-chat-react-native';

const SomeChildComponent = () => {
  const { handleDelete, handleRetry } = useMessagesContext();

  return (
    <View />
  )
}
  • Class component
import React from 'react';
import { withMessagesContext } from 'stream-chat-react-native';

class SomeChildComponent extends React.Component {
  constructor(props) {
    super(props);

    console.log(props.handleDelete);
    console.log(props.handleRetry);
    console.log(props.refreshing);
  }

  // UI Logic
}

Please check the OverlayContextValue in OverlayContext, for consumable values. Provider for this context exists in OverlayProvider component. And so, any child component of OverlayProvider can get access to context as following:

  • Functional component
import { useOverlayContext } from 'stream-chat-react-native';

const SomeChildComponent = () => {
  const { openPicker, closePicker } = useOverlayContext();

  return (
    <View />
  )
}
  • Class component
import React from 'react';
import { withOverlayContext } from 'stream-chat-react-native';

class SomeChildComponent extends React.Component {
  constructor(props) {
    super(props);

    console.log(props.openPicker);
    console.log(props.closePicker);
  }

  // UI Logic
}

Please check the PaginatedMessageListContextValue in PaginatedMessageListContext, for consumable values. Provider for this context exists in Channel component. And so, any child component of Channel can get access to context as following:

  • Functional component
import { usePaginatedMessageListContext } from 'stream-chat-react-native';

const SomeChildComponent = () => {
  const { loadMore, loadingMore, loadMoreRecent, loadingMoreRecent } = usePaginatedMessageListContext();

  return (
    <View />
  )
}
  • Class component
import React from 'react';
import { withPaginatedMessageListContext } from 'stream-chat-react-native';

class SomeChildComponent extends React.Component {
  constructor(props) {
    super(props);

    console.log(props.loadMore);
    console.log(props.loadMoreRecent);
  }

  // UI Logic
}

Please check the ThreadContexttValue in ThreadContextt, for consumable values. Provider for this context exists in Channel component. And so, any child component of Channel can get access to context as following:

  • Functional component
import { useThreadContextt } from 'stream-chat-react-native';

const SomeChildComponent = () => {
  const { openThread, threadMessages } = useThreadContextt();

  return (
    <View />
  )
}
  • Class component
import React from 'react';
import { withThreadContextt } from 'stream-chat-react-native';

class SomeChildComponent extends React.Component {
  constructor(props) {
    super(props);

    console.log(props.openThread);
    console.log(props.threadMessages);
  }

  // UI Logic
}

Please check the TypingContextValue in TypingContext, for consumable values. Provider for this context exists in Channel component. And so, any child component of Channel can get access to context as following:

  • Functional component
import { useTypingContext } from 'stream-chat-react-native';

const SomeChildComponent = () => {
  const { typing } = useTypingContext();

  return (
    <View />
  )
}
  • Class component
import React from 'react';
import { withTypingContext } from 'stream-chat-react-native';

class SomeChildComponent extends React.Component {
  constructor(props) {
    super(props);

    console.log(props.typing);
  }

  // UI Logic
}

Stream Chat React Native - Docs