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
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
2 changed files with 34 additions and 20 deletions

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 />,
},
])
)

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 />,
},
])
)