We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ccf3fa commit 82d76dbCopy full SHA for 82d76db
packages/next/src/client/components/navigation.ts
@@ -172,13 +172,13 @@ export function useParams<T extends Params = Params>(): T {
172
173
return useMemo(() => {
174
// When it's under app router
175
- if (globalLayoutRouter) {
+ if (globalLayoutRouter?.tree) {
176
return getSelectedParams(globalLayoutRouter.tree) as T
177
}
178
179
// When it's under client side pages router
180
return pathParams as T
181
- }, [globalLayoutRouter, pathParams])
+ }, [globalLayoutRouter?.tree, pathParams])
182
183
184
// TODO-APP: handle parallel routes
0 commit comments