Skip to content

Commit

Permalink
Merge pull request #197 from SCBJ-7/feature/#195-global-suspense
Browse files Browse the repository at this point in the history
[#195] 글로벌 서스펜스 추가 및 모든 서스펜스에 로딩컴포넌트 추가
  • Loading branch information
Bumang-Cyber authored Jan 25, 2024
2 parents 6bcdae0 + f3c3d7b commit 1550e85
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/routes/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ import SaleDetail from "@pages/saleDetailPage/SaleDetail";
export const router = createBrowserRouter([
{
path: PATH.ROOT,
element: <App />,
element: (
<Suspense fallback={<Loading />}>
<App />
</Suspense>
),
errorElement: <NotFound />,
children: [
{
Expand Down Expand Up @@ -91,7 +95,7 @@ export const router = createBrowserRouter([
path: PATH.WRITE_TRANSFER,
element: (
<LocalErrorBoundary>
<Suspense fallback={<div>{/* loading */}</div>}>
<Suspense fallback={<Loading />}>
<TransferWriting />
</Suspense>
</LocalErrorBoundary>
Expand All @@ -100,15 +104,15 @@ export const router = createBrowserRouter([
{
path: PATH.WRITE_TRANSFER_PRICE + `/:id`,
element: (
<Suspense fallback={<div>{/* loading */}</div>}>
<Suspense fallback={<Loading />}>
<TransferWritingPrice />
</Suspense>
),
},
{
path: PATH.WRITE_TRANSFER_SUCCESS,
element: (
<Suspense fallback={<div>{/* loading */}</div>}>
<Suspense fallback={<Loading />}>
<TransferWritingSuccess />
</Suspense>
),
Expand Down Expand Up @@ -141,7 +145,7 @@ export const router = createBrowserRouter([
path: PATH.PURCAHSE_DEATAIL,
element: (
<LocalErrorBoundary>
<Suspense fallback={<div>LOADING</div>}>
<Suspense fallback={<Loading />}>
<PurchaseDetail />
</Suspense>
</LocalErrorBoundary>
Expand Down

0 comments on commit 1550e85

Please sign in to comment.