I'm running this very simple stagger animation, where I switch between 2 values on x by passing it a function, which was a common technique in gsap since ever. I noticed the animation behaves unpredictably and the staggers aren't linear, and seems it running 3 times and logging these their index values all over… I know i can use gsap.utils.wrap for this case, but this will be a common pattern in my GSAP animations and this left me wondering if somehow I'm messing up the way I should connect my GSAP animations to Svelte?
Bad performance when using a simple stagger with Scrolltrigger in Svelte
in GSAP
Posted
Hi
I'm running this very simple stagger animation, where I switch between 2 values on
x
by passing it a function, which was a common technique in gsap since ever. I noticed the animation behaves unpredictably and the staggers aren't linear, and seems it running 3 times and logging these their index values all over… I know i can usegsap.utils.wrap
for this case, but this will be a common pattern in my GSAP animations and this left me wondering if somehow I'm messing up the way I should connect my GSAP animations to Svelte?Here's a Svelte REPL with the example:
https://svelte.dev/repl/2add39882b9748758f2f8de72701cf0e?version=3.46.4