Concurrent React and Suspense · senior
How Suspense works
A component "suspends" when the data or code it needs is not ready; React shows the nearest <Suspense> fallback and retries rendering when the promise resolves, so loading states are declared by tree position instead of isLoading flags.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Sources that suspend:
lazy()components,use(promise)with a cached promise, Suspense-enabled data libraries and frameworks (Next.js Server Components, TanStack QueryuseSuspenseQuery).useEffectfetching does not suspend. - Internally a suspending component throws a promise (a "thenable"); React catches it at the nearest boundary, shows the fallback, and re-renders when it settles. Rejections go to the nearest error boundary.
- The promise must be stable across renders (created by a cache, a framework, or a Server Component). A promise created during render is new every time and suspends forever.
- Boundary placement is UX design: nested boundaries reveal progressively; sibling boundaries can cause "popcorn" UI; one boundary around a group reveals it together.
- During a transition React keeps showing the old content instead of falling back again.
- React 19: when something suspends, React commits the nearest fallback immediately, then pre-warms suspended siblings.
- On the server, Suspense boundaries let React stream HTML: the shell first, then each boundary's content when ready. React 19.2 batches server-rendered boundary reveals briefly (stopping as total load nears the 2.5 s LCP threshold).
- React 19.3: wrapping Suspense in
<ViewTransition>animates fallback-to-content; images and fonts inside a<ViewTransition>can suspend while loading.
The red pen
Common traps: mistake → fix
Mistake: "Suspense is a loading-spinner component"
Fix: it is a coordination mechanism; the fallback is just its UI.
Mistake: "
use(fetch(url))in a client component works"Fix: a new promise every render; it never resolves to stable content.
Mistake: "Suspense catches errors"
Fix: errors go to error boundaries; wrap both.
Easy to hard
Questions interviewers ask, easy to hard
- How does Suspense work under the hood?
- How is it used for code splitting, data fetching and streaming SSR?
- Why must the promise passed to
use()not be created during render? - Nested vs sibling boundaries: how do you avoid popcorn UI?
- How does Suspense relate to selective hydration?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.