#useRouter next/navigation how to do shallow routing?
9 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
useParams, usePathname seem useful so I started using them in the page router. not sure if this is ideal
I think that only works in the app router right?
if you use the pages router you should use next/router instead of next/navigation
Gotcha. how about the other hooks such as useParams, usePathname? would it be fine to use those in page router? seems like they are supported
any reasons you don't use useRouter().query and useRouter().pathname?
I can. There are components that might be used in both app and page router during the migration so I was trying to see if it was possible to update those components to use these hooks first