Skip to content

Commit 77a9093

Browse files
committed
fix: prevent "onRest" calls when disposed
Reported by: #642 (comment)
1 parent cb0238d commit 77a9093

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/core/src/SpringValue.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,10 @@ export class SpringValue<T = any, P extends string = string>
343343
/** Prevent future animations, and stop the current animation */
344344
dispose() {
345345
if (!this.is(DISPOSED)) {
346+
if (this.animation) {
347+
// Prevent "onRest" calls when disposed.
348+
this.animation.onRest = undefined
349+
}
346350
this.stop()
347351
this._phase = DISPOSED
348352
}

0 commit comments

Comments
 (0)