diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java index 2cadd153c..52519e9d3 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java @@ -216,6 +216,12 @@ public class FabricUIManager implements UIManager { Log.d(TAG, "appendChild \n\tparent: " + parent + "\n\tchild: " + child); } try { + // If the child to append is shared with another tree (child.getParent() != null), + // then we add a mutation of it. In the future this will be performed by FabricJS / Fiber. + //TODO: T27926878 avoid cloning shared child + if (child.getParent() != null) { + child = child.mutableCopy(); + } parent.addChildAt(child, parent.getChildCount()); } catch (Throwable t) { handleException(parent, t);