AI SDK 3.0: Stream React Components from LLMs to deliver richer user experiences
vercel.com
vercel.com
The example code is confusing me, because there is a `render()` method that references both `<Weather>` and `<Spinner>`, but neither of these JSX components are imported into the script. (In fact, `getWeather()` isn't defined, either.) Is that the part I'm missing? The LLM will just see these component references and know how to render them? Or is the codeblock wrong? Because this is technically invalid syntax (reference to undefined).
We kept the code snippets in the blog post brief, but you can see the full code for the demo here: https://github.com/vercel/ai/tree/main/examples/next-ai-rsc
tip: have your network tab open so you can inspect the responses as components stream in