-
Notifications
You must be signed in to change notification settings - Fork 0
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
hibo
committed
Feb 28, 2024
1 parent
00854c9
commit e71defe
Showing
4 changed files
with
67 additions
and
62 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
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,11 @@ | ||
import { RouterProvider } from "react-router-dom"; | ||
import { router } from "."; | ||
import { useMemo } from 'react'; | ||
import { RouterProvider } from 'react-router-dom'; | ||
import { createRouter } from '.'; | ||
|
||
export function RoutesApp() { | ||
return ( | ||
<RouterProvider router={router} future={{ v7_startTransition: true }} /> | ||
); | ||
const memorizedRouter = useMemo(() => { | ||
// mswの設定がされた後にrouterを作成する | ||
return createRouter(); | ||
}, []); | ||
return <RouterProvider router={memorizedRouter} future={{ v7_startTransition: true }} />; | ||
} |
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