next redirect to page react code example
Example 1: how to redirect to a website in react
window.location.href = 'http://domain.com';
Example 2: redirect to in react js
<Route exact path="/">
{loggedIn ? <Redirect to="/dashboard" /> : <PublicHomePage />}
</Route>