Course contentsShow
← React
Lesson 1319 of 2,39633. Error BoundariesFree lesson

Degraded UI vs Full Failure

Show partial UI when non-critical components fail rather than replacing entire sections with error screens.

Degraded UI vs Full Failure

What you'll learn: How to keep most of your app functioning by showing partial UI when non-critical components fail, instead of replacing entire sections with error screens.


The Philosophy: Graceful Degradation

When an error boundary catches an error, you have two choices:

  1. Full Failure: Replace the entire section with an error screen
  2. Degraded UI: Keep working parts visible, show minimal fallback for the broken piece

Full failure is appropriate for critical features (checkout forms, authentication). But for non-critical features (comments section, recommendation widget, analytics dashboard), you can often render something useful while indicating a problem.

The Analogy: A Restaurant Kitchen

If the ice cream machine breaks, you don't close the entire restaurant. You put up a small "Sorry, no desserts today" sign and keep serving meals. That's degraded UI.

If the gas line fails, you do close everything—that's full failure for critical systems.

Implementation Strategy

Place granular error boundaries around non-critical components. Instead of one boundary wrapping your entire feature, wrap individual pieces:

<Dashboard>
  <ErrorBoundary fallback={<div>Stats unavailable</div>}>
    <StatsWidget />
  </ErrorBoundary>
  
  <ErrorBoundary fallback={<div>Chart loading failed</div>}>
    <Chart />
  </ErrorBoundary>
  
  <DataTable /> {/* Still works if widgets fail */}
</Dashboard>

If StatsWidget crashes, users still see the chart and table. The broken widget shows a small message instead of taking down the whole dashboard.

When to Choose Each

  • Degraded UI: User-generated content, analytics, recommendations, social features
  • Full Failure: Payment forms, authentication, data submission, core navigation

Key Takeaway: Use fine-grained error boundaries around non-critical components to show partial UI with small failure indicators, rather than replacing entire features with error screens—keep the working parts working.