usePathname / getPathname in React Server Components (RSC) #65282
Unanswered
vordgi
asked this question in
App Router
Replies: 1 comment
-
She did give a detailed answer regarding the layout. What about templates, then? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just now, @delbaoliveira gave a detailed answer on why it's not possible to get the path in Layout and RSC (many thanks for that, team position responses are very important!).
But I still have a question. In your responses over and over again, the reason is explained as "layout does not re-render". Now
PPR segments
will not be re-rendered either.But this implies only one consequence - pathname should not be accessible within layout and PPR segments. So why not go the way of blocking the path retrieval API only in these abstractions?
The current situation suggests that a static site in next.js is incomplete.
I'll explain with a specific example why this is needed:
ABCD
, or tariffsABCE
. At the same time, they have a large volume of data and walking to the server for information. Therefore, I want to have them specifically as a server component.With respect, the author of mentioned in the closed task nimpl-getters, containing this functionality!
Beta Was this translation helpful? Give feedback.
All reactions