변경 전
import { useHistory } from "react-router-dom";
const history = useHistory();
history.push("/");
history.replace("/");
변경 후
import { useNavigate } from "react-router-dom";
const navigate = useNavigate();
navigate("/");
navigate("/", { replace:true });