Next.js Discord

Discord Forum

pathname and query are not accessible in router.push() using next/navigation

Answered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
I couldn't find pathname and query in new next/navigation like this code raising error
router.push({ pathname: "/auth/sign-in", query: router.query });
Answered by riský
you just make a url like you see in the url now, for example:
router.push(`/auth/signin?a=b`)
View full answer

1 Reply

@Sun bear I couldn't find pathname and query in new next/navigation like this code raising error router.push({ pathname: "/auth/sign-in", query: router.query });
you just make a url like you see in the url now, for example:
router.push(`/auth/signin?a=b`)
Answer