Chat Viewer
    Preparing search index...

    Function followMessagesAtBottom

    • Performs a scroll to the bottom of the chat viewer when the chat is at the bottom. It returns a generic OnMessagesCallback that can be used with the chat viewer. Typical behavior of the chat apps is to scroll to the bottom when a new message arrives, but only if the user is already at the bottom of the chat. It will not scroll if the user has scrolled up to view older messages.

      Type Parameters

      Parameters

      • opts: ScrollToIndexOpts = DEFAULT_SCROLL_OPTS

        ScrollToItemOpts options for controlling the scroll behavior

      Returns OnMessagesCallback<M>

      A callback that performs the scroll action.

      <ChatViewer
      messages={messages}
      renderMessage={renderMessage}
      onNewerMessages={followMessagesAtBottom()}
      />