basementstudio / scrollytelling

A library for creating Scrollytelling animations, powered by React & GSAP.
http://scrollytelling.basement.studio
Other
1.09k stars 33 forks source link

onRefresh callback is not stable #47

Closed liho00 closed 8 months ago

liho00 commented 10 months ago
 <Scrollytelling.Root
      scrub={0.75}
      callbacks={{
        onRefresh: () => {
          console.log("refresh", progress.value); // most of the time return `refresh 0` as screenshot below
          update(progress.value);
        },
      }}
    >
image
julianbenegas commented 10 months ago

hey @liho00, from the GSAP docs (enter that link and command + f "onRefresh"):

onRefresh: A callback for when the a refresh occurs (typically a resize event) which forces the ScrollTrigger to recalculate all of its positioning.

Is this what you want? You may be looking for onUpdate.