Closed tomashco closed 1 month ago
I have exactly the same issue.
Fixed in https://github.com/payloadcms/payload/pull/7545
Will be available after next beta release
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.
Link to reproduction
No response
Payload Version
3.0.0-beta.50
Node Version
v20.10.0
Next.js Version
15.0.0-rc.0
Describe the Bug
I can correctly import my Custom View component wrapped inside DefaultTemplate, but the Navbar is not populated if you link directly to the Custom View page.
This is what I found after digging a bit: The navigation context lives in the client and for what I understood there is no way to get it from server side. Thus if you do the navigation adding your link to the custom view through the afterNavLinks array of components, there will not be a full refresh of the page, thus the navigation context will be preserved and you will be able to continue to see the nav links.
On the other hand, hitting directly the custom-view route you will not have the navigation, thus you will be able to see only the afterNavLinks components, but not all the other links. The same happens if you navigate to the Custom View using the afterNavLinks and then you refresh the page, as described in the Reproduction Steps.
Reproduction Steps
in payload repo run
pnpm dev admin
before refresh:
after refresh:
Adapters and Plugins
No response