We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91f8049 commit 57768d9Copy full SHA for 57768d9
client/dashboard/app/layout.tsx
@@ -10,6 +10,15 @@ import { getRouter } from './router';
10
function RouterProviderWithAuth( { config }: { config: AppConfig } ) {
11
const auth = useAuth();
12
const router = useMemo( () => getRouter( config ), [ config ] );
13
+
14
+ router.subscribe( 'onBeforeLoad', () => {
15
+ if ( document.startViewTransition ) {
16
+ document.startViewTransition( () => {
17
+ window.scrollTo( 0, 0 );
18
+ } );
19
+ }
20
21
22
return <RouterProvider router={ router } context={ { auth, config } } />;
23
}
24
0 commit comments