diff --git a/packages/waku/src/router/client.ts b/packages/waku/src/router/client.ts index f3bc8728e..09a272408 100644 --- a/packages/waku/src/router/client.ts +++ b/packages/waku/src/router/client.ts @@ -349,25 +349,17 @@ const InnerRouter = ({ const changeRoute: ChangeRoute = useCallback( (route, options) => { const { skipRefetch } = options || {}; - const performChange = () => { - startTransition(() => { - if (!staticPathSet.has(route.path) && !skipRefetch) { - const rscPath = encodeRoutePath(route.path); - const rscParams = createRscParams(route.query); - refetch(rscPath, rscParams); - } - if (options.shouldScroll) { - handleScroll(); - } - setRoute(route); - }); - }; - - if ('startViewTransition' in document) { - document.startViewTransition(performChange); - } else { - performChange(); - } + startTransition(() => { + if (!staticPathSet.has(route.path) && !skipRefetch) { + const rscPath = encodeRoutePath(route.path); + const rscParams = createRscParams(route.query); + refetch(rscPath, rscParams); + } + if (options.shouldScroll) { + handleScroll(); + } + setRoute(route); + }); }, [refetch, staticPathSet], ); @@ -411,11 +403,8 @@ const InnerRouter = ({ '', url, ); - changeRoute(parseRoute(url), { - skipRefetch: true, - shouldScroll: false, - }); } + changeRoute(parseRoute(url), { skipRefetch: true, shouldScroll: false }); }; locationListeners.add(callback); return () => {