253
suspense
also Suspense boundary
A suspense boundary shows a fallback while a child waits. It is not a try/catch.
What is suspense?
Suspense catches a promise thrown by a child, or a lazy component, and renders a fallback until it resolves. The boundary should wrap the part that waits, not the whole app. Errors are a different boundary. A fallback that is the entire page is a spinner with extra machinery.
Why does suspense matter when vibe coding?
The draft wraps the root in one Suspense and uses it to catch errors. The whole app flashes. The error still crashes, because suspense does not handle exceptions.
How do you do suspense?
Put the boundary around the slow subtree. Give it a fallback that matches the layout. Pair it with an error boundary. Do not suspend the shell.
How do you ask a model for suspense?
Wrap (slow part) in a suspense boundary with a fallback that keeps (shell) visible. Add an error boundary for failures. Do not wrap the whole app. Do not use suspense as try/catch.
What goes wrong with suspense?
A fallback with a different height than the content. The page jumps when the promise resolves.