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
You can use useRouteMatch hook
const ParentComponent = props => { const matched = useRouteMatch(['/', '/login']) if (matched && matched.isExact) return null return }