Question · Next.js course · Module 2: Routing and Layouts

Hooks for Shallow Routing

Which 'next/navigation' hooks do you use together with window.history.pushState for shallow routing with query parameters?

Answer options

  • useEffect and useState
  • useSearchParams and usePathname
  • useContext and useReducer
  • useMemo and useCallback
Show the answer

Correct answer:

  • useSearchParams and usePathname