VirtualizedMessageListContext

The context value is provided by VirtualizedMessageListContextProvider which wraps the contents rendered by VirtualizedMessageList. It exposes API that the default and custom components rendered by VirtualizedMessageList can take advantage of. The components that can consume the context are:

Basic Usage

Pull the value from context with our custom hook:

import { useVirtualizedMessageListContext } from "stream-chat-react";

export const CustomComponent = () => {
  const { scrollToBottom } = useVirtualizedMessageListContext();
  // component logic ...
  return {
    /* rendered elements */
  };
};

Value

scrollToBottom

Function that scrolls the list to the bottom.

Type
() => void
© Getstream.io, Inc. All Rights Reserved.