arayaroma/ether/react-error-boundaries

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when a React subtree should fail gracefully instead of blanking the whole app on a render/lifecycle error — class-based ErrorBoundary component with a retry action.

Install

npx vskill@latest install arayaroma/ether/react-error-boundaries

SKILL.md

Error boundary pattern

Error boundaries must be class components (no hook equivalent exists) — getDerivedStateFromError for the fallback render, componentDidCatch for logging.

tsx
interface ErrorBoundaryState {
hasError: boolean;
error: Error | null;
}
export class ErrorBoundary extends React.Component<{ children: React.ReactNode }, ErrorBoundaryState> {
state: ErrorBoundaryState = { hasError: false, error: null };
static getDerivedStateFromError(error: Error): ErrorBoundaryState {
return { hasError: true, error };
}
componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
console.error('Error boundary caught:', error, errorInfo);
// also report to your error tracker here
}
render() {
if (this.state.hasError) {
return (
<div className="error-fallback">
<h2>Something went wrong</h2>
<p>{this.state.error?.message}</p>
<button onClick={() => this.setState({ hasError: false })}>Try again</button>
</div>
);
}
return this.props.children;
}
}
// <ErrorBoundary><App /></ErrorBoundary>

Placement

  • One boundary at the app root as a last-resort catch-all is not enough by itself — wrap

independent feature sections (a chart, a widget, a routed page) in their own boundary so one broken feature doesn't blank the whole screen.

  • Error boundaries do not catch errors in event handlers, async code, SSR, or the boundary's

own render — wrap those with regular try/catch and set error state normally.

  • The "Try again" reset only clears the boundary's own state; if the error came from bad data

still in a parent store, retrying will immediately re-throw. Pair retry with actually refetching or clearing the bad state, not just flipping hasError back to false.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/arayaroma/ether/react-error-boundaries/badge)](https://verified-skill.com/skills/arayaroma/ether/react-error-boundaries)

Something wrong with this skill or its page? Tell us.