Overview of the MessageList component
mainThe MessageList component is used to display a list of messages in a chat interface. It is designed to be highly extensible and performant, featuring:
- Automatic Rendering: It automatically selects and renders the correct component based on the message type.
- Extensibility: You can register custom message renderers using the
MessageRendererRegistry. - Optimized Performance: Each message is memoized to ensure that during streaming, only the active message re-renders. For very large histories, you can enable Virtualization via the
virtualizedprop to keep the DOM size constant usingreact-window. - Smart Action Filtering: The component automatically excludes
assistantActionswhen rendering 'thinking' messages. - User Rating Support: You can set the
userRatingon assistant messages to control the filled state of like/dislike icons.