react hook history code example
Example: usehistory
import { useHistory } from "react-router-";
function HomeButton() {
let history = useHistory();
function handleClick() {
history.push("/home");
}
return (
);
}
import { useHistory } from "react-router-";
function HomeButton() {
let history = useHistory();
function handleClick() {
history.push("/home");
}
return (
);
}