Skip to content

Commit 1afee0b

Browse files
syaaufacebook-github-bot
authored andcommitted
Native Animated - Override __makeNative in AnimatedInterpolation
Summary: Fixes the error `Trying to update interpolation node that has not been attached to the parent` in android which occurs when using multiple Animated.Values along with interpolation and an animation is run before another one that uses interpolation. On ios, no error is thrown in such case but the animation also doesn't work as expected. You can check the snack code here which works properly without useNativeDriver: true. But fails on android and skips the first stage of animation on ios. https://snack.expo.io/HyD3zdjSZ **Test Plan** The animations worked properly after the __makeNative override made the parent node native as well. <!-- Thank you for sending the PR! If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos! Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native. Happy contributing! --> Closes facebook#15077 Differential Revision: D5449066 Pulled By: shergin fbshipit-source-id: 2f0b6ea712a0ab12c1c545514a3686a9a6aeebed
1 parent af48b48 commit 1afee0b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Libraries/Animated/src/AnimatedImplementation.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,11 @@ class AnimatedInterpolation extends AnimatedWithChildren {
11241124
this._interpolation = Interpolation.create(config);
11251125
}
11261126
1127+
__makeNative() {
1128+
this._parent.__makeNative();
1129+
super.__makeNative();
1130+
}
1131+
11271132
__getValue(): number | string {
11281133
var parentValue: number = this._parent.__getValue();
11291134
invariant(

0 commit comments

Comments
 (0)