react redirect import code example
Example 1: how to use redirect in react
import { useHistory } from "react-router-dom";
function App() {
let history = useHistory();
}
Example 2: redirect to another path react
<span className="input-group-btn">
<Link to="/login" />Click to login</Link>
</span>