perf: enable router navigation transition

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2024-12-03 15:54:46 +08:00
parent 7ad1e305c3
commit 24e1aead5e
2 changed files with 34 additions and 20 deletions
+17 -10
View File
@@ -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 />,
},
])
)
+17 -10
View File
@@ -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 />,
},
])
)