Breadcrumbs in admin header aren't updating when using custom view
Link to reproduction
https://github.com/payloadcms/payload/tree/v3.0.0-beta.113/examples/custom-components
Environment Info
Binaries: Node: 22.8.0 npm: 10.8.2 Yarn: 1.22.22 pnpm: 9.12.1 Relevant Packages: payload: 3.0.0-beta.106 next: 15.0.0-canary.160 @payloadcms/db-mongodb: 3.0.0-beta.106 @payloadcms/graphql: 3.0.0-beta.106 @payloadcms/next/utilities: 3.0.0-beta.106 @payloadcms/richtext-lexical: 3.0.0-beta.106 @payloadcms/translations: 3.0.0-beta.106 @payloadcms/ui/shared: 3.0.0-beta.106 react: 19.0.0-rc-5dcb0097-20240918 react-dom: 19.0.0-rc-5dcb0097-20240918 Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020 Available memory (MB): 32768 Available CPU cores: 10
Describe the Bug
When visiting a custom view after a collection list or document edit view, the breadcrumbs to the collection or document remain in the header.
Reproduction Steps
- Run the custom-components example (when I did this, beta branch was at 113, and the example was pinned to 106. But the problem persistend when I unpinned the payload/next dependencies too)
- Visit a collection and/or document edit view.
- Navigate to /admin/custom-default
- The header still shows [logo] / [ Collection Name ] / [Document Name]
I'd really like to override the actual dashboard component too (admin.components.Dashboard.Component) but the same thing happens
Adapters and Plugins
No response
any solution or any comments for above issue?
This issue has been marked as stale due to lack of activity.
To keep this issue open, please indicate that it is still relevant in a comment below.
It is relevant
The bug/issue is still there
I'm having the same problem
Append the SetStepNav component inside DefaultTemplate:
<DefaultTemplate ...>
<SetStepNav nav={[{ label: "My Custom Section" }]} />
</DefaultTemplate>
I had found out about useStepNav, but I had to create a client component to use it.
This is even better, thanks!
By the way, it would be nice if this were in the docs, especially this one https://payloadcms.com/docs/custom-components/custom-views#view-templates
Append the
SetStepNavcomponent insideDefaultTemplate:<DefaultTemplate ...> <SetStepNav nav={[{ label: "My Custom Section" }]} /> </DefaultTemplate>
I had the same problem and this is the solution. Please add it to custom-views documentation!