aboutsummaryrefslogtreecommitdiff
path: root/src/ErrorBoundary.tsx
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-05-26 10:48:43 +0200
committerAriel Costas Guerrero <ariel@costas.dev>2025-05-26 10:48:43 +0200
commit5ced7f916d94e86e9a7ec164bee56f9a8e3a2a3a (patch)
treeb1ef5afa17b4a2f9fb2cbd683afc2fb6d905b5e1 /src/ErrorBoundary.tsx
parent4637373b50636e78dc2c7b6f99be879edb4ff7dc (diff)
Replace Azure SWA with custom server
Diffstat (limited to 'src/ErrorBoundary.tsx')
-rw-r--r--src/ErrorBoundary.tsx46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/ErrorBoundary.tsx b/src/ErrorBoundary.tsx
deleted file mode 100644
index 2372f9b..0000000
--- a/src/ErrorBoundary.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import React, { Component, ReactNode } from 'react';
-
-interface ErrorBoundaryProps {
- children: ReactNode;
-}
-
-interface ErrorBoundaryState {
- hasError: boolean;
- error: Error | null;
-}
-
-class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
- constructor(props: ErrorBoundaryProps) {
- super(props);
- this.state = {
- hasError: false,
- error: null
- };
- }
-
- static getDerivedStateFromError(error: Error): ErrorBoundaryState {
- return {
- hasError: true,
- error
- };
- }
-
- componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
- console.error("Uncaught error:", error, errorInfo);
- }
-
- render() {
- if (this.state.hasError) {
- return <>
- <h1>Something went wrong.</h1>
- <pre>
- {this.state.error?.stack}
- </pre>
- </>;
- }
-
- return this.props.children;
- }
-}
-
-export default ErrorBoundary; \ No newline at end of file