Globales Ranking · von 601 Skills
react-error-handling AI Agent Skill
Quellcode ansehen: oakoss/agent-skills
SafeInstallation
npx skills add oakoss/agent-skills --skill react-error-handling 45
Installationen
React Error Handling
Overview
Error boundaries catch JavaScript errors during rendering, in lifecycle methods, and in constructors of child components. They display fallback UIs instead of crashing the entire component tree. Error boundaries can only be implemented as class components in vanilla React, but the react-error-boundary library provides a convenient function component wrapper.
When to use: Component crashes, preventing error propagation to parent routes, graceful degradation, user-facing error states, error logging and monitoring.
When NOT to use: Event handler errors (use try/catch), async callbacks outside rendering (setTimeout, promises without Suspense), server-side rendering errors, errors in the boundary itself.
Quick Reference
| Pattern | API | Key Points |
|---|---|---|
| Class boundary | getDerivedStateFromError + componentDidCatch |
Manual implementation, full control |
| Function boundary | <ErrorBoundary FallbackComponent={...} /> |
Uses react-error-boundary library |
| Reset mechanism | resetErrorBoundary() or resetKeys={[dep]} |
Auto-reset on state change or manual retry |
| Error logging | onError={(error, info) => log(error)} |
Log to analytics or monitoring service |
| Fallback component | FallbackComponent={MyFallback} |
Receives error and resetErrorBoundary |
| Inline fallback | fallback={<div>Error occurred</div>} |
Static JSX, no error details |
| Render prop fallback | fallbackRender={({ error, reset }) => <UI />} |
Dynamic fallback with error access |
| Nested boundaries | Wrap at multiple tree levels | Granular error isolation |
| Route-level boundary | TanStack Router errorComponent |
Delegate to tanstack-router skill |
| Suspense integration | Wrap Suspense boundaries for async errors | Catch errors thrown by Suspense |
| Event handler errors | try/catch in handler, not error boundary |
Boundaries don't catch event errors |
| useErrorBoundary hook | const { showBoundary, resetBoundary } = useErrorBoundary |
Manually trigger boundary from child |
Common Mistakes
| Mistake | Correct Pattern |
|---|---|
| Using error boundary for events | Use try/catch in event handlers |
| Wrapping every single component | Place boundaries at meaningful UI sections |
| Not providing reset mechanism | Include retry button or resetKeys |
| Showing stack traces in prod | Only render stack in development mode |
| Missing onError for logging | Always log errors to monitoring service |
| Catching errors in boundary self | Error boundaries only catch child component errors |
| Using async code in getDerived | getDerivedStateFromError must be pure, use didCatch |
| Relying on componentDidCatch | Use getDerivedStateFromError for state updates |
| Not testing error boundaries | Test with error-throwing components |
| Ignoring resetKeys pattern | Use resetKeys for automatic recovery on state change |
| Blocking Suspense fallbacks | Error boundaries around Suspense should allow fallbacks |
Delegation
If the
tanstack-routerskill is available, delegate route-level error handling (errorComponent, notFoundComponent, loader errors) to it. Otherwise, recommend:npx skills add oakoss/agent-skills --skill tanstack-router
- Error monitoring setup: Delegate to integration/observability specialists
- Complex recovery flows: Use
Taskagent for multi-step error recovery patterns - Error boundary testing: Delegate test writing to testing specialists
References
Installationen
Sicherheitsprüfung
Quellcode ansehen
oakoss/agent-skills
Mehr aus dieser Quelle
Power your AI Agents with
the best open-source models.
Drop-in OpenAI-compatible API. No data leaves Europe.
Explore Inference APIGLM
GLM 5
$1.00 / $3.20
per M tokens
Kimi
Kimi K2.5
$0.60 / $2.80
per M tokens
MiniMax
MiniMax M2.5
$0.30 / $1.20
per M tokens
Qwen
Qwen3.5 122B
$0.40 / $3.00
per M tokens
So verwenden Sie diesen Skill
Install react-error-handling by running npx skills add oakoss/agent-skills --skill react-error-handling in your project directory. Führen Sie den obigen Installationsbefehl in Ihrem Projektverzeichnis aus. Die Skill-Datei wird von GitHub heruntergeladen und in Ihrem Projekt platziert.
Keine Konfiguration erforderlich. Ihr KI-Agent (Claude Code, Cursor, Windsurf usw.) erkennt installierte Skills automatisch und nutzt sie als Kontext bei der Code-Generierung.
Der Skill verbessert das Verständnis Ihres Agenten für react-error-handling, und hilft ihm, etablierte Muster zu befolgen, häufige Fehler zu vermeiden und produktionsreifen Code zu erzeugen.
Was Sie erhalten
Skills sind Klartext-Anweisungsdateien — kein ausführbarer Code. Sie kodieren Expertenwissen über Frameworks, Sprachen oder Tools, das Ihr KI-Agent liest, um seine Ausgabe zu verbessern. Das bedeutet null Laufzeit-Overhead, keine Abhängigkeitskonflikte und volle Transparenz: Sie können jede Anweisung vor der Installation lesen und prüfen.
Kompatibilität
Dieser Skill funktioniert mit jedem KI-Coding-Agenten, der das skills.sh-Format unterstützt, einschließlich Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider und anderen Tools, die projektbezogene Kontextdateien lesen. Skills sind auf Transportebene framework-agnostisch — der Inhalt bestimmt, für welche Sprache oder welches Framework er gilt.
Chat with 100+ AI Models in one App.
Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.