In the current version of React Router (v3) I can accept a server response and use browserHistory.push
to go to the appropriate response page. However, this isn
Now with react-router v5 you can use the useHistory lifecycle hook like this:
import { useHistory } from "react-router-dom";
function HomeButton() {
let history = useHistory();
function handleClick() {
history.push("/home");
}
return (
);
}
read more at: https://reacttraining.com/react-router/web/api/Hooks/usehistory