Active Links in a Server Side NavBar ?
Answered
Sun bear posted this in #help-forum
Sun bearOP
I am importing session and using next-auth in my navbar so it has to be a server component. I would also like my active links to have a different bg but need states for that. How do i not make it a client but still have active links ? thank you
Answered by joulev
You have to use client components, but you don’t have to make the whole navbar a client component. https://nextjs-forum.com/post/1224347507434197052#message-1225254644843024454
2 Replies
@Sun bear I am importing session and using next-auth in my navbar so it has to be a server component. I would also like my active links to have a different bg but need states for that. How do i not make it a client but still have active links ? thank you
You have to use client components, but you don’t have to make the whole navbar a client component. https://nextjs-forum.com/post/1224347507434197052#message-1225254644843024454
Answer
Sun bearOP
thanks 🙏