Skip to content

Animated spring callback not called immediately after the animation finishes #20783

@MarkOSullivan94

Description

@MarkOSullivan94

Environment

Environment:
OS: Linux 4.4
Node: 9.4.0
Yarn: Not Found
npm: 6.2.0
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found

Packages: (wanted => installed)
react: ^16.3.1 => 16.4.2
react-native: ^0.56.0 => 0.56.0

Description

This issue had been originally brought up back in 2015 but was never sorted #1951

There is a noticeable delay in the callback which is triggered after the animation ends, this is a major issue whenever you want to hide / show content once the animation is finished and so it would be great if this delay could be completely eliminated.

I have noticed that Animated.timing(...) does not have this delay after the animation has finished.

Reproducible Demo

I did try and get a expo snack demo working but wasn't able to.

Below is the code I use to setup the animation

let animation = Animated.timing(
			this.state.animation,
			{
				toValue: finalValue,
			}
);

animation.start(this._animationFinishCallback());

Below is the callback trigger when the animation finishes.

_animationFinishCallback = () => {
		console.log("animationFinish");
};

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions