Internal context for GroupChannel For example, the developer can create a custom header with getting data from the domain context

Hierarchy

  • GroupChannelContextsType

Properties

Fragment: Context<{
    channel: GroupChannel;
    headerTitle: string;
    keyboardAvoidOffset?: number;
    messageToEdit?: FileMessage | UserMessage;
    messageToReply?: FileMessage | UserMessage;
    setMessageToEdit: ((msg?) => void);
    setMessageToReply: ((msg?) => void);
}>

Type declaration

  • channel: GroupChannel
  • headerTitle: string
  • Optional keyboardAvoidOffset?: number
  • Optional messageToEdit?: FileMessage | UserMessage
  • Optional messageToReply?: FileMessage | UserMessage
  • setMessageToEdit: ((msg?) => void)
      • (msg?): void
      • Parameters

        • Optional msg: FileMessage | UserMessage

        Returns void

  • setMessageToReply: ((msg?) => void)
      • (msg?): void
      • Parameters

        • Optional msg: FileMessage | UserMessage

        Returns void

MessageList: Context<{
    flatListRef: MutableRefObject<null | FlatList<any>>;
    lazyScrollToBottom: ((params?) => void);
    lazyScrollToIndex: ((params?) => void);
    scrollToMessage: ((messageId, options?) => boolean);
}>

Type declaration

  • flatListRef: MutableRefObject<null | FlatList<any>>

    ref object for FlatList of MessageList

  • lazyScrollToBottom: ((params?) => void)
      • (params?): void
      • Call the FlatList function asynchronously to scroll to bottom lazily to avoid scrolling before data rendering has been committed.

        Parameters

        • Optional params: {
              animated?: boolean;
              timeout?: number;
          }
          • Optional animated?: boolean
          • Optional timeout?: number

        Returns void

  • lazyScrollToIndex: ((params?) => void)
      • (params?): void
      • Call the FlatList function asynchronously to scroll to index lazily. to avoid scrolling before data rendering has been committed.

        Parameters

        • Optional params: {
              animated?: boolean;
              index?: number;
              timeout?: number;
              viewPosition?: number;
          }
          • Optional animated?: boolean
          • Optional index?: number
          • Optional timeout?: number
          • Optional viewPosition?: number

        Returns void

  • scrollToMessage: ((messageId, options?) => boolean)
      • (messageId, options?): boolean
      • Function that scrolls to a message within a group channel.

        Parameters

        • messageId: number

          {number} - The id of the message to scroll.

        • Optional options: {
              focusAnimated?: boolean;
              viewPosition?: number;
          }

          {object} - Scroll options (optional).

          • Optional focusAnimated?: boolean

            {boolean} - Enable a shake animation on the message component upon completion of scrolling.

          • Optional viewPosition?: number

            {number} - Position information to adjust the visible area during scrolling. bottom(0) ~ top(1.0)

        Returns boolean

        Example

          const { scrollToMessage } = useContext(GroupChannelContexts.MessageList);
        const messageIncludedInMessageList = scrollToMessage(lastMessage.messageId, { focusAnimated: true, viewPosition: 1 });
        if (!messageIncludedInMessageList) console.warn('Message not found in the message list.');
PubSub: Context<PubSub<GroupChannelPubSubContextPayload>>
TypingIndicator: Context<{
    typingUsers: User[];
}>

Type declaration

  • typingUsers: User[]

Generated using TypeDoc