redirect in react router 4 code example
Example: redirect react router
<Route exact path="/">
{loggedIn ? <Redirect to="/profile" /> : <HomePage />}
</Route>
<Route exact path="/">
{loggedIn ? <Redirect to="/profile" /> : <HomePage />}
</Route>