From 82d76dbcbe8e5f1b6831dec43338d09bb50b4644 Mon Sep 17 00:00:00 2001 From: Zack Tanner Date: Thu, 12 Oct 2023 19:11:19 -0700 Subject: [PATCH] tighten dependency --- packages/next/src/client/components/navigation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/src/client/components/navigation.ts b/packages/next/src/client/components/navigation.ts index 934801222db7b..9dfb75b3fa373 100644 --- a/packages/next/src/client/components/navigation.ts +++ b/packages/next/src/client/components/navigation.ts @@ -172,13 +172,13 @@ export function useParams(): T { return useMemo(() => { // When it's under app router - if (globalLayoutRouter) { + if (globalLayoutRouter?.tree) { return getSelectedParams(globalLayoutRouter.tree) as T } // When it's under client side pages router return pathParams as T - }, [globalLayoutRouter, pathParams]) + }, [globalLayoutRouter?.tree, pathParams]) } // TODO-APP: handle parallel routes