useRouter import not working?

just following the docs and trying to add shallow routing. In my app/page.tsx i have the following
"use client";

import { useRouter } from "next/router";

export default function Page() {
const router = useRouter();

...
}
"use client";

import { useRouter } from "next/router";

export default function Page() {
const router = useRouter();

...
}
im getting the following: Error: NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted anyone know why this might be happening?
1 Reply
JJ Rise
JJ Rise13mo ago
I believe you need to be importing useRouter from next/navigation not next/router
Want results from more Discord servers?
Add your server