Skip to content

Commit 1f77801

Browse files
genkikondofacebook-github-bot
authored andcommitted
Fix JS animated node value updating when listener is attached
Summary: The JS-side animated node values were not being updated on AnimatedValue (and thus AnimatedValueXY); however, the native event "onAnimatedValueUpdate" is being handled properly in AnimatedNode. It turns out that single underscore prefixed methods are obfuscated at FB. And thus AnimatedValue._onAnimatedValueUpdateReceived was not getting called. Changing the method name to double underscore as a way to denote "protected" fixes the issue. Changelog: [General][Fixed] - JS animated node value updates properly when listener is attached Reviewed By: yungsters Differential Revision: D33962038 fbshipit-source-id: c4f60e1f1ccc0cef3e65b89034bdb91376a26416
1 parent 08faa13 commit 1f77801

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Libraries/Animated/nodes/AnimatedNode.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ class AnimatedNode {
130130
if (data.tag !== this.__getNativeTag()) {
131131
return;
132132
}
133-
this._onAnimatedValueUpdateReceived(data.value);
133+
this.__onAnimatedValueUpdateReceived(data.value);
134134
},
135135
);
136136
}
137137

138-
_onAnimatedValueUpdateReceived(value: number) {
138+
__onAnimatedValueUpdateReceived(value: number) {
139139
this.__callListeners(value);
140140
}
141141

Libraries/Animated/nodes/AnimatedValue.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class AnimatedValue extends AnimatedWithChildren {
211211
}
212212
}
213213

214-
_onAnimatedValueUpdateReceived(value: number): void {
214+
__onAnimatedValueUpdateReceived(value: number): void {
215215
this._updateValue(value, false /*flush*/);
216216
}
217217

0 commit comments

Comments
 (0)