I\'m using react-router and I want to render a menu component when the user is not in the root and not in the /login path. This is what I have so far
Regex in the route path didn't work for me. What worked for me was this. Just add the other condition.
{ return location.pathname.indexOf('/login') === -1 ? TopMenuComponent : null }} />