removed error boundary

This commit is contained in:
Андрей Бабушкин 2025-03-05 16:11:40 +01:00
parent 2b1a9f3378
commit 97d4c672a7
2 changed files with 1 additions and 35 deletions

View file

@ -1,31 +0,0 @@
import React, { Component } from 'react';
class ErrorBoundary extends Component {
constructor(props) {
super(props);
this.state = { hasError: false, error: null };
}
static getDerivedStateFromError(error) {
return { hasError: true, error };
}
componentDidCatch(error, errorInfo) {
console.error('Error caught:', error, errorInfo);
// Здесь можно отправить ошибку в сервис аналитики
}
render() {
if (this.state.hasError) {
return this.props.fallback ? (
this.props.fallback(this.state.error)
) : (
<div>Произошла ошибка: {this.state.error?.message}</div>
);
}
return this.props.children;
}
}
export default ErrorBoundary;

View file

@ -13,7 +13,6 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { StoreProvider, RootStore } from './mstore';
import Router from './Router';
import './i18n';
import ErrorBoundary from './ErrorBoundary';
// @ts-ignore
window.getCommitHash = () => console.log(window.env.COMMIT_HASH);
@ -75,7 +74,6 @@ document.addEventListener('DOMContentLoaded', () => {
// const theme = window.localStorage.getItem('theme');
root.render(
<ErrorBoundary>
<QueryClientProvider client={queryClient}>
<ConfigProvider theme={customTheme}>
<App>
@ -90,7 +88,6 @@ document.addEventListener('DOMContentLoaded', () => {
</StoreProvider>
</App>
</ConfigProvider>
</QueryClientProvider>
</ErrorBoundary>,
</QueryClientProvider>,
);
});