I would like to implement that kind of routes in react-router v4.
/auth => auth home page
/auth/login => login page
/auth/register => register page
/auth/forgot => lost password page
/auth/reset => change password page
It doesn't work with <Switch>
because it first match /auth
and render the associated component. So as I click on the link to go to the login page
for instance it renders the Auth Component
and not the Login Component
.
How can I implement that behavior with react-router ?
I tried nested routing but if I take the same example as before, It would renders the Auth Component + Login Component
.
Thanks.