File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
packages/motion-dom/src/animation Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 5
5
pipe ,
6
6
secondsToMilliseconds ,
7
7
} from "motion-utils"
8
+ import { frame } from "../frameloop/frame"
8
9
import { time } from "../frameloop/sync-time"
9
10
import { activeAnimations } from "../stats/animation-count"
10
11
import { mix } from "../utils/mix"
@@ -433,16 +434,13 @@ export class JSAnimation<T extends number | string>
433
434
* animation.stop is returned as a reference from a useEffect.
434
435
*/
435
436
stop = ( ) => {
436
- const { motionValue } = this . options
437
- if ( motionValue && motionValue . updatedAt !== time . now ( ) ) {
438
- this . tick ( time . now ( ) )
439
- }
440
-
441
- this . isStopped = true
442
- if ( this . state === "idle" ) return
443
- this . teardown ( )
444
- const { onStop } = this . options
445
- onStop && onStop ( )
437
+ frame . preRender ( ( ) => {
438
+ this . isStopped = true
439
+ if ( this . state === "idle" ) return
440
+ this . teardown ( )
441
+ const { onStop } = this . options
442
+ onStop && onStop ( )
443
+ } )
446
444
}
447
445
448
446
complete ( ) {
You can’t perform that action at this time.
0 commit comments