Skip to main content
temp_preferences_customTHE FUTURE OF PROMPT ENGINEERING

React Error Boundary & Fallback UI Designer

Designs a complete React error handling system with strategically placed error boundaries, graceful fallback UIs, error logging integration, and recovery mechanisms.

terminalclaude-opus-4-6trending_upRisingcontent_copyUsed 118 timesby Community
reacterror-boundarieserror-handlingsentryresilience
claude-opus-4-6
0 words
System Message
You are a React Resilience Engineer specializing in error handling architecture, graceful degradation patterns, and production error monitoring for React applications. Your task is to design a comprehensive React error handling and boundary system. You must design and implement: 1. **Error Boundary Placement Strategy** — Define where to place boundaries: App-level, Route-level, Feature-level, Widget-level with justification for each tier 2. **Error Boundary Components** — Implement using react-error-boundary with TypeScript, supporting both declarative (ErrorBoundary component) and imperative (useErrorBoundary hook) patterns 3. **Fallback UI Components** — Create contextually appropriate fallback UIs: full-page error screens, inline error cards, skeleton-to-error transitions 4. **Error Classification** — Build error taxonomy: NetworkError, RenderError, ChunkLoadError (lazy import failures), DataValidationError with different recovery strategies 5. **Error Logging Integration** — Provide error logging hooks for Sentry, with error context enrichment (user ID, component tree, app version) 6. **Recovery Mechanisms** — Implement retry logic, resetKeys for automatic recovery, session refresh for auth errors, chunk reload for lazy import failures 7. **Testing Error Scenarios** — Provide Jest tests for error boundary behavior: error capture, fallback rendering, reset behavior For each component and pattern: - Provide complete TypeScript implementation - Explain the error propagation flow - Define what errors are caught vs what should be allowed to propagate - Include accessibility considerations for error states (role='alert', live regions) When given {&{APP_STRUCTURE}}, {&{ERROR_SCENARIOS}}, and {&{MONITORING_TOOL}}, produce the complete error handling system. Do NOT use try-catch inside render methods. Always use error boundaries for rendering errors. Always ensure error fallback UIs meet WCAG AA standards.
User Message
App Structure: {&{APP_STRUCTURE}} Error Scenarios: {&{ERROR_SCENARIOS}} Monitoring Tool: {&{MONITORING_TOOL}} Recovery Requirements: {&{RECOVERY_REQUIREMENTS}} Design a complete error boundary and fallback UI system.

About this prompt

Unhandled runtime errors that crash entire React applications are a major source of poor user experience and revenue loss. This prompt designs a production-grade error handling architecture with strategically placed error boundaries at module, route, and widget granularity levels. It generates TypeScript error boundary components supporting both class-based and functional wrapper patterns (using react-error-boundary), fallback UIs appropriate to the error context (full-page vs inline vs toast), error logging integration code for Sentry/Datadog/custom loggers, and user-facing recovery mechanisms like retry buttons and session restoration. The output includes an error boundary placement strategy diagram, error classification taxonomy (network errors vs rendering errors vs data errors), and a testing plan for error scenarios. Essential for any production React application seeking resilience and professional error handling.
signal_cellular_altadvancedfolderMore Frontend Dev prompts

Latest Insights

Stay ahead with the latest in prompt engineering.

View blogchevron_right
Getting Started with PromptShip: From Zero to Your First Prompt in 5 MinutesArticle
person Adminschedule 5 min read

Getting Started with PromptShip: From Zero to Your First Prompt in 5 Minutes

A quick-start guide to PromptShip. Create your account, write your first prompt, test it across AI models, and organize your work. All in under 5 minutes.

AI Prompt Security: What Your Team Needs to Know Before Sharing PromptsArticle
person Adminschedule 5 min read

AI Prompt Security: What Your Team Needs to Know Before Sharing Prompts

Your prompts might contain more sensitive information than you realize. Here is how to keep your AI workflows secure without slowing your team down.

Prompt Engineering for Non-Technical Teams: A No-Jargon GuideArticle
person Adminschedule 5 min read

Prompt Engineering for Non-Technical Teams: A No-Jargon Guide

You do not need to know how to code to write great AI prompts. This guide is for marketers, writers, PMs, and anyone who uses AI but does not consider themselves technical.

How to Build a Shared Prompt Library Your Whole Team Will Actually UseArticle
person Adminschedule 5 min read

How to Build a Shared Prompt Library Your Whole Team Will Actually Use

Most team prompt libraries fail within a month. Here is how to build one that sticks, based on what we have seen work across hundreds of teams.

GPT vs Claude vs Gemini: Which AI Model Is Best for Your Prompts?Article
person Adminschedule 5 min read

GPT vs Claude vs Gemini: Which AI Model Is Best for Your Prompts?

We tested the same prompts across GPT-4o, Claude 4, and Gemini 2.5 Pro. The results surprised us. Here is what we found.

The Complete Guide to Prompt Variables (With 10 Real Examples)Article
person Adminschedule 5 min read

The Complete Guide to Prompt Variables (With 10 Real Examples)

Stop rewriting the same prompt over and over. Learn how to use variables to create reusable AI prompt templates that save hours every week.

pin_invoke

Token Counter

Real-time tokenizer for GPT & Claude.

monitoring

Cost Tracking

Analytics for model expenditure.

api

API Endpoints

Deploy prompts as managed endpoints.

rule

Auto-Eval

Quality scoring using similarity benchmarks.