From bb9b71fccd29daea4af9b4e39509bbab2322d1fb Mon Sep 17 00:00:00 2001 From: Marin Atanasov <8436925+tyxla@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:11:48 +0200 Subject: [PATCH] Actually prevent transition --- packages/router/src/router.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/router/src/router.tsx b/packages/router/src/router.tsx index 7c237ccce8da2..34cc542c7b573 100644 --- a/packages/router/src/router.tsx +++ b/packages/router/src/router.tsx @@ -125,21 +125,18 @@ export function useHistory() { ! options.transition ) { performPush(); + return; } await new Promise< void >( ( resolve ) => { const classname = options.transition ?? ''; - if ( classname ) { - document.documentElement.classList.add( classname ); - } + document.documentElement.classList.add( classname ); // @ts-expect-error const transition = document.startViewTransition( () => performPush() ); transition.finished.finally( () => { - if ( classname ) { - document.documentElement.classList.remove( classname ); - } + document.documentElement.classList.remove( classname ); resolve(); } ); } );