Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/thatstupidcomputer / apps/web/src/animation/core/AnimationBoundary.tsx |
| Date | Not specified in source |
| Repository | Janady13/thatstupidcomputer |
| Revision | 57555cde46910102dd25d6c1c1fb2c359e9655bd |
| Branch | main |
| Path or archive member | apps/web/src/animation/core/AnimationBoundary.tsx |
| Original SHA-256 | d665fe61882ed09bf1933f243ffccc14356f3892bc3ba53a6884c20c9b2a57d9 |
| Git blob SHA | 5089ac6fb154ab721d2b63152a808fdeed7cf07b |
| Reading-copy SHA-256 | d665fe61882ed09bf1933f243ffccc14356f3892bc3ba53a6884c20c9b2a57d9 |
Recovered source transcript
Download complete source text ↓9 lines · 0.5 KB
'use client';
import { Component, type ReactNode, type ErrorInfo } from 'react';
export class AnimationBoundary extends Component<{children: ReactNode; fallback: ReactNode; onError?: (error: unknown) => void}, {failed: boolean}> {
state = { failed: false };
static getDerivedStateFromError() { return { failed: true }; }
componentDidCatch(error: Error, _info: ErrorInfo) { this.props.onError?.(error); }
render() { return this.state.failed ? this.props.fallback : this.props.children; }
}