When I want to navigate using the <MenuItem>
as follows
<MenuItem onTouchTap={() => {this.handleClose()}}>
<NavLink to="/api/logout">Sign Out</NavLink>
</MenuItem>
that is just putting the mentioned 'to' attribute value /api/logout
in the URL linked to the existing route without going to that path and ending up having the link on the browser as http://localhost:3000/api/logout, without going there on the logout route at the nodejs backend server! that is a problem.
Note that I use proxy to directs from 3000 to 5000 as follows
"proxy": {
"/api/*": {
"target": "http://localhost:5000"
}
},
Generally speaking, I guess that is because the difference between <Link>
and <NavLink>
.
If you would like to know more about from where this problem has come out, you can take a look at my previous post how navigate using the MenuItem? material-ui V1 but that is not necessary.