Set measure function after YogaNode has been copied

Reviewed By: mdvacca

Differential Revision: D7338948

fbshipit-source-id: e805169e162a47d0c7c775a3decbe9013c27c0e4
This commit is contained in:
Andrew Chen (Eng)
2018-03-21 17:43:11 -07:00
committed by Facebook Github Bot
parent 96daf677b7
commit 47910f0cad
2 changed files with 15 additions and 6 deletions

View File

@@ -1024,11 +1024,6 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
@Override
public void setMeasureFunction(YogaMeasureFunction measureFunction) {
if ((measureFunction == null ^ mYogaNode.isMeasureDefined()) && getChildCount() != 0) {
throw new RuntimeException(
"Since a node with a measure function does not add any native yoga children, it's "
+ "not safe to transition to/from having a measure function unless a node has no children");
}
mYogaNode.setMeasureFunction(measureFunction);
}