Active link without making it a client component
Answered
New Guinea Freshwater Crocodile posted this in #help-forum
New Guinea Freshwater CrocodileOP
Currently I am using the "usePathname" hook from "next/navigation" to check if I need the active class on a link. But this requires it to be a Client component.
Is there a way to check if the current link path without making it a client component?
Is there a way to check if the current link path without making it a client component?
7 Replies
Holland Lop
why do you have Link's that point to possibly non-existent paths?
in other words, what is the context of this question
what's wrong with client components? active/inactive states of links are interactive client-side states so client components are the right tool for the job
New Guinea Freshwater CrocodileOP
Ok thanks
@joulev [no](<https://nextjs-faq.com/get-pathname-in-rsc>)
Argente Brun
As far as I understood - moving something into client component is worse for SEO, and if our main menu is the main-juicy-part of the page for our SEO-bots, moving it into client-component will make it worse - no?