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
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.
Thank you , I haven't checked this properly, will try using this