Replies: 4 comments 4 replies
-
The feature requests talking about this are readily closed by NextJS maintainers, who say that the behavior is intentional because the layout doesn't re-render for different pages: What is, then, their excuse for templates? How come templates do not have access to the current route? |
Beta Was this translation helpful? Give feedback.
-
This article is inaccurate and I would highly recommend not following the patterns it is showing. Futher, I would recommend to the authors to remove this utility from their package, as it is likely to break. Please see this comment for the correct answer: #43704 (comment) |
Beta Was this translation helpful? Give feedback.
-
@leerob Still no explanation why TEMPLATES cannot access the path of the current page being rendered under them. |
Beta Was this translation helpful? Give feedback.
-
The DX of next has definitely dropped from 9/10 about 2-3 years ago, to 3/10 at best now |
Beta Was this translation helpful? Give feedback.
-
Do you think the existence of an article like this: https://www.propelauth.com/post/getting-url-in-next-server-components, or issues like this shows us that the developer experience is bad in this area?
180 votes ·
Beta Was this translation helpful? Give feedback.
All reactions