Info:
This is documentation for Stream Chat React SDK v12, which is no longer actively maintained. For up-to-date documentation, see the latest version (v14).

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
Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat React v12: <Your Question>