Skip to content

Commit

Permalink
tighten dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ztanner committed Oct 13, 2023
1 parent 8ccf3fa commit 82d76db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/next/src/client/components/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ export function useParams<T extends Params = Params>(): 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
Expand Down

0 comments on commit 82d76db

Please sign in to comment.