更新至 v0.6.0_20251125 版本

This commit is contained in:
2025-11-25 22:31:59 +08:00
parent b53183e931
commit 66fa85e474
6 changed files with 274 additions and 43 deletions

View File

@@ -1,9 +1,8 @@
import React, { Component, ErrorInfo, ReactNode } from "react";
import { AlertCircle, RefreshCw, Trash2 } from 'lucide-react';
interface Props {
children: ReactNode;
children?: ReactNode;
}
interface State {
@@ -12,10 +11,13 @@ interface State {
}
export class ErrorBoundary extends Component<Props, State> {
public state: State = {
hasError: false,
error: null
};
constructor(props: Props) {
super(props);
this.state = {
hasError: false,
error: null
};
}
public static getDerivedStateFromError(error: Error): State {
return { hasError: true, error };
@@ -67,4 +69,4 @@ export class ErrorBoundary extends Component<Props, State> {
return this.props.children;
}
}
}