react router redirect to link code example
Example 1: redirect react router
<Route exact path="/">
{loggedIn ? <Redirect to="/profile" /> : <HomePage />}
</Route>
Example 2: redirect react router
<Redirect to="/somewhere/else" />
<Route exact path="/">
{loggedIn ? <Redirect to="/profile" /> : <HomePage />}
</Route>
<Redirect to="/somewhere/else" />