const hoverVarient = {
init: {
x: "-100vw",
},
mid: {
x: 0,
},
hoverI: {
scale: 1.1,
transition: {
yoyo: 10,
},
},
};
<m.button
variants={hoverVarient}
initial="init"
animate="mid"
whileHover="hoverI"
>
const location = useLocation();
return (
<AnimatePresence mode="wait">
<Routes location={location} key={location.pathname}> ... </Routes>
</AnimatePresence>
transition: {
yoyo: 10,
},