Skip to content

Commit 129180c

Browse files
phamfoofacebook-github-bot
authored andcommitted
Fix natively driven animations not getting reset properly (#29585)
Summary: Fixes #28517 Animated.loop needs to reset the animation after each iteration but currently, natively driven animations are not getting reset properly. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Fixed] - Fix natively driven animations not getting reset properly Pull Request resolved: #29585 Test Plan: Tested within RNTester Reviewed By: kacieb Differential Revision: D28383538 Pulled By: yungsters fbshipit-source-id: 40790ad8f825c402afc3515ef6afc00570704109
1 parent 7252798 commit 129180c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Libraries/Animated/nodes/AnimatedValue.js

+6
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ class AnimatedValue extends AnimatedWithChildren {
196196
resetAnimation(callback?: ?(value: number) => void): void {
197197
this.stopAnimation(callback);
198198
this._value = this._startingValue;
199+
if (this.__isNative) {
200+
NativeAnimatedAPI.setAnimatedNodeValue(
201+
this.__getNativeTag(),
202+
this._startingValue,
203+
);
204+
}
199205
}
200206

201207
_onAnimatedValueUpdateReceived(value: number): void {

0 commit comments

Comments
 (0)