React Fiber introduces a new error-handling mechanism called Error Boundaries, which allows developers to catch errors in the component tree and display a fallback UI. Error Boundaries are components that implement the componentDidCatch method or use the static getDerivedStateFromError method. When an error occurs within a component tree, React will look for the nearest Error Boundary and delegate error handling to it, preventing the entire application from crashing.
If a child component throws an exception while rendering, what does React Fiber do and how would you prevent the whole app from crashing?
Show me how you would add an error boundary around a small widget so that a rendering error only hides that widget, not the rest of the page.
During a feature rollout a third‑party library throws inside a useEffect. The page crashes even though you have a top‑level error boundary. Walk me through why Fiber didn't catch it and how you would fix it.
You notice that a component wrapped in Suspense throws a network error and the fallback never appears. Explain how Fiber propagates that error and what changes you’d make to handle it gracefully.
Design an error‑handling strategy for a large application that mixes many nested Suspense and error boundaries. How would you decide where to place boundaries to minimize UI disruption and ensure proper logging?
Compare the trade‑offs of putting a single error boundary at the root versus adding per‑feature error boundaries. Discuss the impact on Fiber's error propagation and any performance considerations.
Your organization is migrating a legacy codebase that uses try/catch in componentWillMount for error handling. How would you refactor the code to leverage Fiber’s error boundaries while keeping behavior consistent across many teams?
We have several micro‑frontends that share a common React root. How would you evolve the error‑handling architecture across these teams, considering Fiber’s error propagation model and the need for unified logging and recovery?