tidy(ui): lift error boundary reset cb outside component

This commit is contained in:
psychedelicious 2025-10-14 11:09:56 +11:00
parent c80c89dfdb
commit 0742ebe11a

View File

@ -3,22 +3,22 @@ import { GlobalHookIsolator } from 'app/components/GlobalHookIsolator';
import { GlobalModalIsolator } from 'app/components/GlobalModalIsolator';
import { clearStorage } from 'app/store/enhancers/reduxRemember/driver';
import { AppContent } from 'features/ui/components/AppContent';
import { memo, useCallback } from 'react';
import { memo } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import AppErrorBoundaryFallback from './AppErrorBoundaryFallback';
import ThemeLocaleProvider from './ThemeLocaleProvider';
const App = () => {
const handleReset = useCallback(() => {
clearStorage();
location.reload();
return false;
}, []);
const errorBoundaryOnReset = () => {
clearStorage();
location.reload();
return false;
};
const App = () => {
return (
<ThemeLocaleProvider>
<ErrorBoundary onReset={handleReset} FallbackComponent={AppErrorBoundaryFallback}>
<ErrorBoundary onReset={errorBoundaryOnReset} FallbackComponent={AppErrorBoundaryFallback}>
<Box id="invoke-app-wrapper" w="100dvw" h="100dvh" position="relative" overflow="hidden">
<AppContent />
</Box>