fix: safari page blank

This commit is contained in:
jialin
2024-11-22 20:16:23 +08:00
parent a6f0f554f0
commit 59d2c5ae3c
3 changed files with 27 additions and 22 deletions
-2
View File
@@ -15,13 +15,11 @@ class ErrorBoundary extends Component<
};
}
// 捕获错误并更新状态
static getDerivedStateFromError(error: any) {
console.error('Error caught by Error Boundary:', error);
return { hasError: true };
}
// 记录错误信息(可选)
componentDidCatch(error: any, info: any) {
console.error('Error caught by Error Boundary:', error);
console.error(info);