im doing a website with antd and i want to do spa website. So, when user clicks on any btn in menu, the content would change. But i cant put my link component in onClick func. Code is there:
<Menu theme="dark" defaultSelectedKeys={['9']} mode="inline" items={items} onClick={(item) => {
if (item.key === '1'){
console.log(1);
//LINK THERE
}
}}/>
I tried to put menu in link tag. it works, but its not what i wanted to.
2
Answers
It solves with useNavigate hook. just put in it your path and it will work
use vanila.js. This can detect all button elements that are clicked