-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: Explain why Layouts (RSCs) can't access pathname
#64785
Conversation
- Add examples of common layout / templates patterns
pathname
All broken links are now fixed, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
I'm not sure you want others to
@delbaoliveira thanks for documenting this! One of the first things that a lot of people run into when trying out the App Router. If some examples of best practice patterns for common things could be added, that would be amazing, eg:
|
ah wait, I think you already did number 1 above ("Active Nav Links") in this PR, thanks!! |
Hey @karlhorky 👋🏼 Nice to see you here! Ah yes, I'll add a few more examples to the docs in the coming days. This Github issue has some good suggestions, it would be good to show how people can achieve these patterns: #43704 I'm also writing a response for that issue that goes into more detail into why. |
pathname
can't be accessed in a layout (file)I'll add layout-specific examples in a follow-up PR, after creating some demos.