Skip to content

Commit

Permalink
perf: enable router navigation transition
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <tukon479@gmail.com>
  • Loading branch information
Innei committed Dec 3, 2024
1 parent 7ad1e30 commit 24e1aea
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
27 changes: 17 additions & 10 deletions apps/renderer/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,22 @@ if (window.SENTRY_RELEASE) {
routerCreator = wrapCreateBrowserRouter(routerCreator)
}

export const router = routerCreator([
export const router = routerCreator(
[
{
path: "/",
Component: App,
children: tree,
errorElement: <ErrorElement />,
},
{
path: "*",
element: <NotFound />,
},
],
{
path: "/",
Component: App,
children: tree,
errorElement: <ErrorElement />,
future: {
v7_startTransition: true,
},
},
{
path: "*",
element: <NotFound />,
},
])
)
27 changes: 17 additions & 10 deletions apps/renderer/src/router.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@ if (window.SENTRY_RELEASE) {
routerCreator = wrapCreateBrowserRouter(routerCreator)
}

export const router = routerCreator([
export const router = routerCreator(
[
{
path: "/",
lazy: () => import("./App"),
children: tree,
errorElement: <ErrorElement />,
},
{
path: "*",
element: <NotFound />,
},
],
{
path: "/",
lazy: () => import("./App"),
children: tree,
errorElement: <ErrorElement />,
future: {
v7_startTransition: true,
},
},
{
path: "*",
element: <NotFound />,
},
])
)

0 comments on commit 24e1aea

Please sign in to comment.