Next.js Discord

Discord Forum

useRouter was not mounted

Answered
Standard Chinchilla posted this in #help-forum
Open in Discord
Standard ChinchillaOP
I have mounted useRouter
Import { useRouter } from 'next/router' ;
But I get a runtime error :
useRouter was not mounted
Answered by joulev
import { useRouter } from "next/navigation"
View full answer

3 Replies

Answer
Standard ChinchillaOP
But it says next/router in the documentation
@Standard Chinchilla But it says next/router in the documentation
if you're using app route it should be from navigation else router