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