FabricUIManagerModuleTest setup and testCloneNode

Reviewed By: mdvacca

Differential Revision: D7037558

fbshipit-source-id: a62617c7e16102cf7d12ecde48a95feec264fa51
This commit is contained in:
Andrew Chen (Eng) 2018-02-21 12:36:41 -08:00 committed by Facebook Github Bot
parent 7dd12a26b9
commit 190e6bef2e
2 changed files with 18 additions and 3 deletions

View File

@ -57,9 +57,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
private static final YogaConfig sYogaConfig;
static {
sYogaConfig = new YogaConfig();
sYogaConfig.setPointScaleFactor(0f);
sYogaConfig.setUseLegacyStretchBehaviour(true);
sYogaConfig = ReactYogaConfigProvider.get();
}
private int mReactTag;

View File

@ -0,0 +1,17 @@
package com.facebook.react.uimanager;
import com.facebook.yoga.YogaConfig;
public class ReactYogaConfigProvider {
private static YogaConfig YOGA_CONFIG;
public static YogaConfig get() {
if (YOGA_CONFIG == null) {
YOGA_CONFIG = new YogaConfig();
YOGA_CONFIG.setPointScaleFactor(0f);
YOGA_CONFIG.setUseLegacyStretchBehaviour(true);
}
return YOGA_CONFIG;
}
}