Get pathname
Answered
African Slender-snouted Crocodil⦠posted this in #help-forum
African Slender-snouted CrocodileOP
How do i get pathname in a server side component for a sidebar check
@Arinji
@Arinji
Answered by Arinji
So yea, you need to make a client component for the component you are making to show the current open window... And usePathname in there
16 Replies
Hola
But basically, not possible
Remember how you went "Hoorah we can make a navbar purely server side"
I was waiting for when you would realize this
I was waiting for when you would realize this
So yea, you need to make a client component for the component you are making to show the current open window... And usePathname in there
Answer
@African Slender-snouted Crocodile
African Slender-snouted CrocodileOP
π
It's fine, all of us go through it at one point in our nextjs journey
Btw, client components aren't like deadly stuff
Feel free to use them whenever needed
They get prerendered on the server as well
African Slender-snouted CrocodileOP
I know, Im just trying to expend my knowledge on server components because my next.js projects feels like React projects π π
African Slender-snouted CrocodileOP
π
Awesome, have a wonderful day ahead! :)