What Suspense Doesn't Handle
What you'll learn: Suspense manages loading states beautifully, but it won't catch errors—you need Error Boundaries for that.
The Gap in Suspense's Coverage
Suspense is fantastic at handling the "not ready yet" state of your components. It detects when data is loading and displays your fallback UI seamlessly. But here's what it doesn't do: handle errors.
If your data fetch fails—network timeout, 404, server error, anything—Suspense won't catch it. The error will bubble up through your component tree just like any other React error. Without an Error Boundary in place, this means your entire app could crash with a white screen.
Why This Matters
Think of Suspense and Error Boundaries as two complementary safety nets for async operations:
- Suspense catches the "waiting" state (loading)
- Error Boundaries catch the "failed" state (errors)
Neither one handles the other's job. This is by design—Suspense is specifically about managing pending states, not failures.
The Complete Async Pattern
For robust async handling, you need both:
<ErrorBoundary fallback={<ErrorMessage />}>
<Suspense fallback={<Spinner />}>
<DataComponent />
</Suspense>
</ErrorBoundary>
This combination gives you complete coverage:
- While loading → Suspense shows the spinner
- If it fails → Error Boundary shows the error message
- If it succeeds → Component renders normally
Key Takeaway: Suspense only handles loading states, not errors. Always wrap Suspense boundaries with Error Boundaries to create a complete async handling strategy that covers both "not ready" and "failed" scenarios.