I need to switch routes with the onWheel event. If the deltaY property of the onWheel event > 0, I call the useNavigate hook to change the route. The problem is that when going back the route changes as many times as I turn the mouse wheel. How do I fix this bug?
const navigate = useNavigate()
const handleWheel = (e) => {
e.deltaY > 0 && navigate("/newRoute")
}