Closed phongtran231 closed 3 months ago
In this document we can use router.push(object with path here) https://next-intl-docs.vercel.app/docs/routing/navigation#apis
but in code useRouter: () => { push: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & { locale?: AppLocales[number] | undefined; }) | undefined) => void; replace: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & { locale?: AppLocales[number] | undefined; }) | undefined) => void; prefetch: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").PrefetchOptions & { locale?: AppLocales[number] | undefined; }) | undefined) => void; back(): void; forward(): void; refresh(): void; }; router.push have to use string as first param
https://github.com/amannn/next-intl-bug-repro-app-router
const router = useRouter();
router.push({ pathname: 'my path string', })
can use with const router = useRouter();
Duplicate of https://github.com/amannn/next-intl/issues/1240#issuecomment-2288503458
Description
In this document we can use router.push(object with path here) https://next-intl-docs.vercel.app/docs/routing/navigation#apis
but in code useRouter: () => { push: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & { locale?: AppLocales[number] | undefined; }) | undefined) => void; replace: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions & { locale?: AppLocales[number] | undefined; }) | undefined) => void; prefetch: (href: string, options?: (import("next/dist/shared/lib/app-router-context.shared-runtime").PrefetchOptions & { locale?: AppLocales[number] | undefined; }) | undefined) => void; back(): void; forward(): void; refresh(): void; }; router.push have to use string as first param
Verifications
Mandatory reproduction URL
https://github.com/amannn/next-intl-bug-repro-app-router
Reproduction description
const router = useRouter();
router.push({ pathname: 'my path string', })
Expected behaviour
can use with const router = useRouter();
router.push({ pathname: 'my path string', })