react reDirect router dom code example
Example 1: react router redirect
<Route exact path="/">
{loggedIn ? <Redirect to="/dashboard" /> : <PublicHomePage />}
</Route>
Example 2: react router redirect
<span className="input-group-btn">
<Link to="/login" />Click to login</Link>
</span>