@@ -98,6 +98,8 @@ public void onNodeCloned(YogaNode oldYogaNode,
98
98
private final boolean [] mPaddingIsPercent = new boolean [Spacing .ALL + 1 ];
99
99
private final YogaNode mYogaNode ;
100
100
101
+ private @ Nullable ReactStylesDiffMap mNewProps ;
102
+
101
103
public ReactShadowNodeImpl () {
102
104
if (!isVirtual ()) {
103
105
YogaNode node = YogaNodePool .get ().acquire ();
@@ -119,7 +121,6 @@ public ReactShadowNodeImpl(ReactShadowNodeImpl original) {
119
121
mShouldNotifyOnLayout = original .mShouldNotifyOnLayout ;
120
122
mNodeUpdated = original .mNodeUpdated ;
121
123
mChildren = original .mChildren == null ? null : new ArrayList <>(original .mChildren );
122
- mParent = null ;
123
124
mIsLayoutOnly = original .mIsLayoutOnly ;
124
125
mTotalNativeChildren = original .mTotalNativeChildren ;
125
126
mNativeParent = original .mNativeParent ;
@@ -133,6 +134,8 @@ public ReactShadowNodeImpl(ReactShadowNodeImpl original) {
133
134
arraycopy (original .mPaddingIsPercent , 0 , mPaddingIsPercent , 0 , original .mPaddingIsPercent .length );
134
135
mYogaNode = original .mYogaNode .clone ();
135
136
mYogaNode .setData (this );
137
+ mParent = null ;
138
+ mNewProps = null ;
136
139
} catch (CloneNotSupportedException e ) {
137
140
// it should never happen
138
141
throw new IllegalArgumentException ();
@@ -152,6 +155,27 @@ public ReactShadowNodeImpl mutableCopyWithNewChildren() {
152
155
return copy ;
153
156
}
154
157
158
+ @ Override
159
+ public ReactShadowNodeImpl mutableCopyWithNewProps (@ Nullable ReactStylesDiffMap newProps ) {
160
+ ReactShadowNodeImpl copy = mutableCopy ();
161
+ if (newProps != null ) {
162
+ copy .updateProperties (newProps );
163
+ copy .mNewProps = newProps ;
164
+ }
165
+ return copy ;
166
+ }
167
+
168
+ @ Override
169
+ public ReactShadowNodeImpl mutableCopyWithNewChildrenAndProps (@ Nullable ReactStylesDiffMap newProps ) {
170
+ ReactShadowNodeImpl copy = mutableCopyWithNewChildren ();
171
+ if (newProps != null ) {
172
+ copy .updateProperties (newProps );
173
+ copy .mNewProps = newProps ;
174
+ }
175
+ return copy ;
176
+ }
177
+
178
+
155
179
/**
156
180
* Nodes that return {@code true} will be treated as "virtual" nodes. That is, nodes that are not
157
181
* mapped into native views (e.g. nested text node). By default this method returns {@code false}.
@@ -360,6 +384,12 @@ public void onAfterUpdateTransaction() {
360
384
// no-op
361
385
}
362
386
387
+ @ Override
388
+ @ Nullable
389
+ public ReactStylesDiffMap getNewProps () {
390
+ return mNewProps ;
391
+ }
392
+
363
393
/**
364
394
* Called after layout step at the end of the UI batch from {@link UIManagerModule}. May be used
365
395
* to enqueue additional ui operations for the native view. Will only be called on nodes marked as
0 commit comments