useNavigation() with Dropdown
Hi! I'm trying to use the useNavigation() hook with Antd's dropdown. I had
Which I changed to
But the first will go to /a/create on loading the page, and the second does not work.
How should I go about this?
const items = {
items: [
{
key: '1',
label: 'a',
onclick: create('a')
},
{
key: '1',
label: 'b',
onclick: create('b')
},
{
key: '1',
label: 'c',
onclick: create('c')
},
{
key: '1',
label: 'Generic',
onclick: create('d')
},
]
}const items = {
items: [
{
key: '1',
label: 'a',
onclick: create('a')
},
{
key: '1',
label: 'b',
onclick: create('b')
},
{
key: '1',
label: 'c',
onclick: create('c')
},
{
key: '1',
label: 'Generic',
onclick: create('d')
},
]
}Which I changed to
const items = {
items: [
{
key: '1',
label: 'a',
onclick: () => {create('a')}
},
{
key: '1',
label: 'b',
onclick: () => {create('b')}
},
{
key: '1',
label: 'c',
onclick: () => {create('c')}
},
{
key: '1',
label: 'd',
onclick: () => {create('d')}
},
]
}const items = {
items: [
{
key: '1',
label: 'a',
onclick: () => {create('a')}
},
{
key: '1',
label: 'b',
onclick: () => {create('b')}
},
{
key: '1',
label: 'c',
onclick: () => {create('c')}
},
{
key: '1',
label: 'd',
onclick: () => {create('d')}
},
]
}But the first will go to /a/create on loading the page, and the second does not work.
How should I go about this?
