From 75d106d878e898e53899ff835a1b660157ab5481 Mon Sep 17 00:00:00 2001 From: Rishika Purbey Date: Fri, 19 Jun 2026 13:54:17 +0530 Subject: [PATCH] fix: reset ErrorBoundary state in-place instead of forcing full page reload --- src/components/ui/ErrorBoundary.jsx | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/components/ui/ErrorBoundary.jsx b/src/components/ui/ErrorBoundary.jsx index e286456..d8a8f96 100644 --- a/src/components/ui/ErrorBoundary.jsx +++ b/src/components/ui/ErrorBoundary.jsx @@ -4,6 +4,7 @@ export class ErrorBoundary extends Component { constructor(props) { super(props); this.state = { hasError: false, error: null }; + this.resetError = this.resetError.bind(this); } static getDerivedStateFromError(error) { @@ -14,6 +15,10 @@ export class ErrorBoundary extends Component { console.error("ErrorBoundary caught an error:", error, errorInfo); } + resetError() { + this.setState({ hasError: false, error: null }); + } + render() { if (this.state.hasError) { return ( @@ -39,12 +44,20 @@ export class ErrorBoundary extends Component {

The application encountered an unexpected error. Don't worry, your data is safe.

- +
+ + +
);