amannn / next-intl

🌐 Internationalization (i18n) for Next.js
https://next-intl-docs.vercel.app
MIT License
2.48k stars 223 forks source link

useRouter not including router.query from nextRouter #1466

Open LeakedDave opened 4 hours ago

LeakedDave commented 4 hours ago

Description

I think this bug is due to useMemo on createNavigation or something, but I am losing everything on the native NextJS router when I use next-intl useRouter. I can't access router.query, and router.replace doesn't let you hide query parameters from the URL (e.g. router.replace("login?returnTo=/edit-profile", "/login"))

Verifications

Mandatory reproduction URL

https://github.com/amannn/next-intl

Reproduction description

Thanks

Expected behaviour

Thanks

LeakedDave commented 4 hours ago

I determined that the issue is actually due to using 'next/navigation' useRouter instead of 'next/router' which only works for App Router, not Pages Router. I don't think wrapping the NextJS Router can work to support both App Router and Pages Router projects