AI Fluency Series · Project 1: Streaming Chat Or: how I spent a day proving a bug I was causing myself. A developer building a streaming chat UI in Next.js discovered that their own performance measurement code (console.log and ref mutations) was preventing the React 19 compiler from optimizing components, causing the very re-renders they were trying to fix. The project, part of an AI fluency series, also revealed common pitfalls like O(N²) re-renders from appending to state arrays and unnecessary re-renders from co-located input state. Disclaimer:a dumb little start to leveling up my AI fluency. Nothing fancy, no grand architecture, no hot takes — just a journal of me trying to actuallyunderstandthings instead of pretending to. Quick filter: if you're on React 19, have actually enabled the compiler it's an opt-in plugin, not something the version hands you for free , and you write pure components — close the tab, you already know the ending. If you're on React 19 and assumed that meant the compiler was on: stay. That assumption is a trap, and I fell in it. Streaming tokens into a growing list that re-renders on every one is the substrate under every AI feature I'm about to build — RAG answers stream, agents stream, all of it. If I can't make token-by-token rendering behave, nothing downstream will. So the rule I gave myself: build it by hand before reaching for the library. No useChat until I've felt the problem it solves. I did it in Next.js — partly because that's where I'm headed, partly as an excuse to learn it — but none of this is Next-specific; any framework does the same thing. And I mocked the stream instead of calling a real model, because the subject is how the UI handles a stream, not the model. A real LLM would just be a slower way to make the same tokens. The setup was deliberately dumb: append each token into one blob of state, map the whole array to the screen. js setChunks prev = ...prev, chunk ; // new array, every token {chunks.map c, i =