Re-enable Yoga cloning in React Shadow Node

Reviewed By: achen1

Differential Revision: D7435365

fbshipit-source-id: 3e04b3252945112cf0c7206b0e6fb63535499eb9
This commit is contained in:
David Vacca 2018-04-01 18:27:11 -07:00 committed by Facebook Github Bot
parent 5be4ff0261
commit 8a99241f81
2 changed files with 2 additions and 9 deletions

View File

@ -96,9 +96,6 @@ public class FabricReconciler {
indicesToRemove.add(0, j);
if (!addedTags.contains(nodeToRemove.getReactTag())) {
tagsToDelete.add(nodeToRemove.getReactTag());
// TODO: T26729293 since we are not cloning ReactShadowNode's we need to "manually" remove
// from the ReactShadowTree when one of the nodes is deleted in JS.
nodeToRemove.getParent().removeChildAt(j);
}
}

View File

@ -150,9 +150,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
@Override
public ReactShadowNodeImpl mutableCopy() {
ReactShadowNodeImpl copy = copy();
copy.mYogaNode = mYogaNode;
// TODO: T26729293 clone YogaNode instead of reusing the same instance
//copy.mYogaNode = mYogaNode.clone();
copy.mYogaNode = mYogaNode.clone();
copy.mNativeChildren = mNativeChildren == null ? null : new ArrayList<>(mNativeChildren);
copy.mTotalNativeChildren = mTotalNativeChildren;
copy.mChildren = mChildren == null ? null : new ArrayList<>(mChildren);
@ -170,9 +168,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
@Override
public ReactShadowNodeImpl mutableCopyWithNewChildren() {
ReactShadowNodeImpl copy = copy();
copy.mYogaNode = mYogaNode;
// TODO: T26729293 clone YogaNode instead of reusing the same instance
//copy.mYogaNode = mYogaNode.clone();
copy.mYogaNode = mYogaNode.cloneWithNewChildren();
copy.mNativeChildren = null;
copy.mChildren = null;
copy.mTotalNativeChildren = 0;