Refactor mapping of FabricComponentNames

Summary: Simple diff that refactors the usage of the sComponentNames to not require components to be part of the mapping when the name in JS is the same as the name in Native side.

Reviewed By: shergin

Differential Revision: D14594659

fbshipit-source-id: d1948b27e04686fefbf9b6e2b06d4f9317b97062
This commit is contained in:
David Vacca
2019-03-29 00:39:43 -07:00
committed by Facebook Github Bot
parent 0c17992485
commit ed0085ca1b

View File

@@ -84,8 +84,6 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
sComponentNames.put("Image", "RCTImageView");
sComponentNames.put("ScrollView", "RCTScrollView");
sComponentNames.put("Slider", "RCTSlider");
sComponentNames.put("ReactPerformanceLoggerFlag", "ReactPerformanceLoggerFlag");
sComponentNames.put("ReactTTRCRenderFlag", "ReactTTRCRenderFlag");
sComponentNames.put("Paragraph", "RCTText");
sComponentNames.put("Text", "RCText");
sComponentNames.put("RawText", "RCTRawText");
@@ -196,7 +194,13 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
String component = sComponentNames.get(componentName);
synchronized (mPreMountItemsLock) {
mPreMountItems.add(
new PreAllocateViewMountItem(context, rootTag, reactTag, component, props, isLayoutable));
new PreAllocateViewMountItem(
context,
rootTag,
reactTag,
component != null ? component : componentName,
props,
isLayoutable));
}
}