mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat(web): enable scroll restoration in TanStack Router
Adds scrollRestoration: true to createRouter configuration to preserve scroll position when navigating between pages, improving navigation UX when switching between views like sessions list and session details.
This commit is contained in:
+5
-1
@@ -240,7 +240,11 @@ export const routeTree = rootRoute.addChildren([
|
||||
type RouterHistory = Parameters<typeof createRouter>[0]['history']
|
||||
|
||||
export function createAppRouter(history?: RouterHistory) {
|
||||
return createRouter({ routeTree, history })
|
||||
return createRouter({
|
||||
routeTree,
|
||||
history,
|
||||
scrollRestoration: true,
|
||||
})
|
||||
}
|
||||
|
||||
export type AppRouter = ReturnType<typeof createAppRouter>
|
||||
|
||||
Reference in New Issue
Block a user