Fix natively driven animations not getting reset properly (#29585)
Summary: Fixes https://github.com/facebook/react-native/issues/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: https://github.com/facebook/react-native/pull/29585 Test Plan: Tested within RNTester Reviewed By: kacieb Differential Revision: D28383538 Pulled By: yungsters fbshipit-source-id: 40790ad8f825c402afc3515ef6afc00570704109
This commit is contained in:
Родитель
7252798abf
Коммит
129180c77b
|
@ -196,6 +196,12 @@ class AnimatedValue extends AnimatedWithChildren {
|
|||
resetAnimation(callback?: ?(value: number) => void): void {
|
||||
this.stopAnimation(callback);
|
||||
this._value = this._startingValue;
|
||||
if (this.__isNative) {
|
||||
NativeAnimatedAPI.setAnimatedNodeValue(
|
||||
this.__getNativeTag(),
|
||||
this._startingValue,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_onAnimatedValueUpdateReceived(value: number): void {
|
||||
|
|
Загрузка…
Ссылка в новой задаче