How to cancel / reset an async chain in useSpring? #1335
Replies: 3 comments
-
There are a few fixes to "async animations" waiting to be released. If you provide a minimal sandbox (fork this one) or |
Beta Was this translation helpful? Give feedback.
-
Hi Alec, thanks for getting back. So i forked the sandbox you provided and made a minimal representation of the problem for you. https://codesandbox.io/s/currying-resonance-614om?file=/src/App.js |
Beta Was this translation helpful? Give feedback.
-
hi @aleclarson did you had a chance to look at the sandbox yet? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation for the changelogs for v9 states:
"Additionally, async animations are no longer cancelled when the props are updated. Async chains (eg: to: [{}, {}]) are never cancelled, even if another chain begins. Async scripts (eg: to: async () => {}) are only interrupted when another script or chain begins."
So i understand that this was intoduced to prevent the animation from cancelling once a rerender happens due to props change, which is good. But if i want to manually cancel this animation how would i do this?
i used the cancel property but that has no effect. Also i tried the reset method, which also had no effect. Additionally i tried using the ref api controller instance and its methods to reset, but that did not work either.
Beta Was this translation helpful? Give feedback.
All reactions