Skip to content

Commit

Permalink
fix: prevent "onRest" calls when disposed
Browse files Browse the repository at this point in the history
Reported by: #642 (comment)
  • Loading branch information
aleclarson committed May 3, 2020
1 parent cb0238d commit 77a9093
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/SpringValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ export class SpringValue<T = any, P extends string = string>
/** Prevent future animations, and stop the current animation */
dispose() {
if (!this.is(DISPOSED)) {
if (this.animation) {
// Prevent "onRest" calls when disposed.
this.animation.onRest = undefined
}
this.stop()
this._phase = DISPOSED
}
Expand Down

0 comments on commit 77a9093

Please sign in to comment.