Hello!
I'm currently migrating my project from the pages router to the app router, and I have a useEffect which had router.asPath as a dependency back with next/router.
What's the migration for that using next/navigation?
Thank you!
Code Snippet:
const router = useRouter()
const [messages, setMessages] = useState<MessageType[]>([]);
const [loading, setLoading] = useState<boolean>(true);
useEffect(() => {
setMessages([]);
setLoading(true);
}, [router.asPath]);