Intermediate React Interview QuestionsIntermediateComparison
React · Question 68
What is the difference between Suspense and an Error Boundary?
Direct answer
Suspense handles content that is temporarily not ready, while an Error Boundary handles supported errors thrown by descendant rendering and displays fallback error UI.
| Concern | Suspense | Error Boundary |
|---|---|---|
| Primary condition | Content is waiting / suspended | Descendant rendering throws an error |
| Fallback meaning | Loading or pending UI | Failure UI |
| Typical pairing | lazy or Suspense-enabled data | Error recovery/logging boundary |
| Same thing? | No | No |
A lazy import that is still loading is handled by Suspense. If that lazy import's loading promise rejects, the error can be handled by the nearest Error Boundary.