"NextRouter was not mounted" in a client component
Answered
Manx posted this in #help-forum
ManxOP
"use client"
import { useRouter } from "next/router";
IDK, how to debug this one!
I found a (Nextjs page)[https://nextjs.org/docs/messages/next-router-not-mounted] that assumes that I'm using that routing method in a testing environment, which is not true.
Answered by Double-striped Thick-knee
if you're using app directory. import it from "next/navigation"
2 Replies
Double-striped Thick-knee
if you're using app directory. import it from "next/navigation"
Answer
ManxOP
My Bad, I just tried it, and it seems to solve the issue. Thanks.