Virtualize a Long Chat Transcript in React
You memoized every message and the chat still stutters at a thousand entries. Virtualization renders only the rows on screen. How to do it, and what breaks.
You memoized every message and the chat still stutters at a thousand entries. Virtualization renders only the rows on screen. How to do it, and what breaks.
An LLM streams tokens and React repaints your whole chat history on every one. How to keep the message list still while a single reply streams in.
A user hits stop or switches chats and the old LLM stream keeps writing tokens and running up cost. How to cancel a streaming fetch in React the right way.
LLM tokens arrive one at a time, and re-parsing Markdown on every token flickers and drags. How to render streaming Markdown in React without the jank.