Mutate shared ReactShadowNode during Fabric.appendChild
Reviewed By: shergin Differential Revision: D7495539 fbshipit-source-id: 2b2b06d3d4f02a00b01c7ed27d47b61787ea922f
This commit is contained in:
parent
9736ddc061
commit
e21bbee586
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue