NextJs router error in app dir

Can anyone help me why I am getting this error ,I have used 'use client' directive in this component , but still its throwing this
2 Replies
Skylarrr
Skylarrr2y ago
Make sure you're importing the correct useRouter from 'next/navigation' instead of 'next/router' if you are using the app dir https://nextjs.org/docs/app/api-reference/functions/use-router
Functions: useRouter
API reference for the useRouter hook.
Yuvaraj
YuvarajOP2y ago
Thank you , I haven't checked this properly, will try using this
Want results from more Discord servers?
Add your server