Skip to content

Commit

Permalink
Native Animated - Call x.__makeNative before super.__makeNative
Browse files Browse the repository at this point in the history
Summary:
This fixes a `Attempt to get native tag from node not marked as "native"` error that happens because some animated values are not converted to native before calling the base class `__makeNative`. This makes sure we call the `__makeNative` method of input nodes before calling `super.__makeNative`.

**Test plan**
Tested that it fixes the issue I encountered and that native animations still work with properly in RNTester.
Closes #14435

Differential Revision: D5236092

Pulled By: javache

fbshipit-source-id: cb02616aec05f220c65b58831ca4334b58d0383b
  • Loading branch information
janicduplessis authored and ide committed Jun 14, 2017
1 parent eb7d3ba commit 08f41bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Libraries/Animated/src/AnimatedImplementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1218,9 +1218,9 @@ class AnimatedDivision extends AnimatedWithChildren {
}

__makeNative() {
super.__makeNative();
this._a.__makeNative();
this._b.__makeNative();
super.__makeNative();
}

__getValue(): number {
Expand Down Expand Up @@ -1266,9 +1266,9 @@ class AnimatedMultiplication extends AnimatedWithChildren {
}

__makeNative() {
super.__makeNative();
this._a.__makeNative();
this._b.__makeNative();
super.__makeNative();
}

__getValue(): number {
Expand Down Expand Up @@ -1309,8 +1309,8 @@ class AnimatedModulo extends AnimatedWithChildren {
}

__makeNative() {
super.__makeNative();
this._a.__makeNative();
super.__makeNative();
}

__getValue(): number {
Expand Down Expand Up @@ -1356,8 +1356,8 @@ class AnimatedDiffClamp extends AnimatedWithChildren {
}

__makeNative() {
super.__makeNative();
this._a.__makeNative();
super.__makeNative();
}

interpolate(config: InterpolationConfigType): AnimatedInterpolation {
Expand Down

0 comments on commit 08f41bc

Please sign in to comment.