Why did an error boundary fail to catch a rejected fetch?
Understand the idea, explain it in your own words and use the rubric to find your next learning gap.
The idea behind the question
Error boundaries contain certain rendering failures in a descendant tree. They are not a universal handler for every event callback, timer or asynchronous operation.
A component has a boundary around its results view, but a request rejected inside an onClick handler still needs explicit error handling.
A practical way to learn it
Build a deliberately failing results component with a boundary, then reject an event-handler request and handle it separately. Explain the different recovery paths.
Open React project studioThe related tool opens separately; your interview answer stays here. Written practice is self-guided, without automatic code grading.
Build an explanation you understand
- State what the concept does in plain language.
- Apply it to the example and make your assumptions explicit.
- Explain a trade-off, failure case and how you would test it.
- Distinguish your actual experience from a proposed approach.
How would you explain it?
Single-question timers reset on refresh. Full mock sessions can resume from this browser.
Strengthen your explanation
Compare reasoning, not identical wording. Reference answers describe a possible approach; replace hypothetical statements with truthful details from your own work.
One way to answer
I would first identify where the exception occurs. A boundary can present a fallback for a descendant rendering failure, but an asynchronous request normally needs its own rejection handling and application error state. I would distinguish an expected API failure from a programming error, give users a useful recovery action and report safe diagnostic context. Boundaries should be placed around meaningful UI regions so one failure does not erase unrelated work. Reset behavior must clear the relevant failed state; an automatic retry loop can repeatedly trigger the same fault.
What a strong explanation should cover
Tick only the points your own answer addresses. This is self-assessment, not AI scoring.
0 / 3 points self-reportedWatch out for
- Wrapping the whole app once and assuming every exception is handled.
Now go one level deeper
- How would you retain an unsaved editor draft when preview rendering fails?
- Which failures should users be allowed to retry?
Further reading
Further-reading links support learning; the reference is Sukoaa-authored, not an official employer answer key.