The motion component has an initial prop:
<motion.div
initial={{ x: "100%" }}
animate={{ x: "calc(100vw - 50%)" }}
/>
while using useAnimate with useInView
hook:
const [scope, animate] = useAnimate();
const isInView = useInView(scope, { once: true, amount: 0.8 });
useEffect(() => {
if (isInView) {
animate('.anim-up', { y: [100, 0] }, { duration: 1, delay: stagger(0.15) })
}
}, [isInView]);
all the elements jump from 0 to 100 at the first keyframe, how to set up an initial value?