Skip to content

Commit 82d76db

Browse files
committed
tighten dependency
1 parent 8ccf3fa commit 82d76db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/next/src/client/components/navigation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ export function useParams<T extends Params = Params>(): T {
172172

173173
return useMemo(() => {
174174
// When it's under app router
175-
if (globalLayoutRouter) {
175+
if (globalLayoutRouter?.tree) {
176176
return getSelectedParams(globalLayoutRouter.tree) as T
177177
}
178178

179179
// When it's under client side pages router
180180
return pathParams as T
181-
}, [globalLayoutRouter, pathParams])
181+
}, [globalLayoutRouter?.tree, pathParams])
182182
}
183183

184184
// TODO-APP: handle parallel routes

0 commit comments

Comments
 (0)