File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed
Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 1717 "motion" : " ^12.25.0" ,
1818 "react" : " ^19.2.3" ,
1919 "react-dom" : " ^19.2.3" ,
20- "react-error-boundary" : " ^6.0.3" ,
2120 "spoiled" : " ^0.4.0" ,
2221 "wouter" : " ^3.9.0"
2322 },
7675 "vite" : " ^7.3.1" ,
7776 "vite-plugin-svgr" : " ^4.5.0"
7877 }
79- }
78+ }
Original file line number Diff line number Diff line change 1+ import { Component } from "react"
2+
3+ class ErrorBoundary extends Component {
4+ constructor ( props ) {
5+ super ( props )
6+ this . state = { hasError : false }
7+ }
8+
9+ static getDerivedStateFromError ( ) {
10+ return { hasError : true }
11+ }
12+
13+ componentDidCatch ( error , errorInfo ) {
14+ console . error ( "ErrorBoundary caught an error:" , error , errorInfo )
15+ }
16+
17+ render ( ) {
18+ if ( this . state . hasError ) {
19+ return this . props . fallback
20+ }
21+
22+ return this . props . children
23+ }
24+ }
25+
26+ export default ErrorBoundary
Original file line number Diff line number Diff line change 11import { use , Suspense } from "react"
22import { formatPercentage } from "../../../utils/number"
3- import { ErrorBoundary } from "react-error-boundary "
3+ import ErrorBoundary from "../../../components/ErrorBoundary "
44
55import Text from "../../../components/Text"
66import Page from "../../../components/Page"
You can’t perform that action at this time.
0 commit comments