Currently I am trying to do some animation transitions with a game I’m building in React and I don’t want the re-render/refresh function of href
or window.location
. How would I use <Link>
from react-router-dom
handled in this regard?
const handleGameOver = () => {
if (health < 1) {
window.location = "/GameOverDied";
} else if (fuel < 1) {
window.location = "/GameOverFuel";
} else {
}
};
I haven’t tried anything yet because I’m not getting the answers I was looking for anywhere else.