Hey
@675733472861487165
The
useStepNavhook should work for you here in your custom view:
https://payloadcms.com/docs/admin/react-hooks#usestepnavThe default list views use it here:
https://github.com/payloadcms/payload/blob/main/packages/ui/src/views/List/index.tsx#L143-L151Already tried it and unfortunately it's throwing error:
And the
SetStepNavcomponent doesn't work for you either?
not really
Can you share how you are defining your custom view
In config
import CustomAnalytics from '@/components/CustomAnalytics'
import { BeforeOperationHook } from 'node_modules/payload/dist/collections/config/types'
import { CollectionConfig, PayloadComponent } from 'payload'
export const Analytics: CollectionConfig = {
slug: 'analytics',
admin: {
useAsTitle: 'title',
group: 'Workspace',
components: {
views: {
list: {
Component: '/components/CustomAnalytics',
},
},
},
},
fields: [
{
name: 'title',
type: 'text',
required: true,
admin: {
hidden: false,
},
},
],
}also when I log nav object, I get undefined so I guess it might be connected to the problem
Yeah, not sure where you are pulling that nav from tbh
But it doesn't get automatically passed in
You should use the collection configs plural label
Like they do here:
https://github.com/payloadcms/payload/blob/main/packages/ui/src/views/List/index.tsx#L145-L150Or some other navItem[]
I
thinkthat's the issue here
I mean even if I manually set string as value, it still returns the same error for the setStepNav, that it's not a function...
Hmm, weird - what Payload version are you using?
3.0
The other guy that you managed to help was facing exactly same problem but for him SetStepNav component worked...
I mean what actual version? 3.0 has had a bunch of releases since launch
Do other hooks work for you?
Try useAuth
Just to test
3.35
fixed it, turns out I had version mismatch :))
Ah very nice!
Glad you figured it out here
Thanks for your help
It's much appreciated
It's my pleasure, truly

Star
Discord
online
Get dedicated engineering support directly from the Payload team.