-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
49 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import { Outlet } from "react-router-dom"; | ||
import { Outlet } from 'react-router-dom'; | ||
import ErrorResetBoundaryWrapper from './shared/error/ErrorResetBoundaryWrapper'; | ||
|
||
/*레이아웃 컴포넌트가 감싸집니다 */ | ||
function App() { | ||
return <Outlet />; | ||
return ( | ||
<ErrorResetBoundaryWrapper> | ||
<Outlet /> | ||
</ErrorResetBoundaryWrapper> | ||
); | ||
} | ||
|
||
export default App; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { RouterProvider } from 'react-router-dom'; | ||
|
||
import { QueryProvider } from './QueryProvider'; | ||
import { ThemeProvider } from './ThemeProvider'; | ||
import ErrorBoundary from '../shared/error/ErrorBoundary'; | ||
import FallbackComponent from '../shared/error/FallbackComponent'; | ||
import router from '../router'; | ||
|
||
const Providers = () => { | ||
return ( | ||
<ErrorBoundary fallback={FallbackComponent}> | ||
<QueryProvider> | ||
<ThemeProvider> | ||
<RouterProvider router={router} /> | ||
</ThemeProvider> | ||
</QueryProvider> | ||
</ErrorBoundary> | ||
); | ||
}; | ||
|
||
export default Providers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { ReactNode } from 'react'; | ||
import { QueryErrorResetBoundary } from '@tanstack/react-query'; | ||
|
||
import ApiErrorBoundary from './ApiErrorBoundary'; | ||
import FallbackComponent from './FallbackComponent'; | ||
|
||
const ErrorResetBoundaryWrapper = ({ children }: { children: ReactNode }) => { | ||
return ( | ||
<QueryErrorResetBoundary> | ||
{({ reset }) => ( | ||
<ApiErrorBoundary fallback={FallbackComponent} onReset={reset}> | ||
{children} | ||
</ApiErrorBoundary> | ||
)} | ||
</QueryErrorResetBoundary> | ||
); | ||
}; | ||
|
||
export default ErrorResetBoundaryWrapper; |