Skip to content

Commit 0dfd233

Browse files
committed
Fix exception: Expected node to be marked as "native"
When using one AnimatedValue to interpolate several properties in one View, it causes the exception to be thrown when the one of the earlier interpolations get natively connected, and the others haven't been made native yet.
1 parent 5442050 commit 0dfd233

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Libraries/Animated/src/nodes/AnimatedProps.js

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ class AnimatedProps extends AnimatedNode {
151151
for (const propKey in this._props) {
152152
const value = this._props[propKey];
153153
if (value instanceof AnimatedNode) {
154+
value.__makeNative();
154155
propsConfig[propKey] = value.__getNativeTag();
155156
}
156157
}

Libraries/Animated/src/nodes/AnimatedStyle.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ class AnimatedStyle extends AnimatedWithChildren {
108108
const styleConfig = {};
109109
for (const styleKey in this._style) {
110110
if (this._style[styleKey] instanceof AnimatedNode) {
111-
styleConfig[styleKey] = this._style[styleKey].__getNativeTag();
111+
const style = this._style[styleKey];
112+
style.__makeNative();
113+
styleConfig[styleKey] = style.__getNativeTag();
112114
}
113115
// Non-animated styles are set using `setNativeProps`, no need
114116
// to pass those as a part of the node config

0 commit comments

Comments
 (0)