Fabric: Quick and diry fix for UnimplementedNativeView

Summary: We have to figure out a different way to request for a fallback component in ComponentDescriptorRegistry and in general, in public APIs. But now, to stop crashing here the fix.

Reviewed By: JoshuaGross

Differential Revision: D15021796

fbshipit-source-id: a60c66838e76ace990f2eb764c86c29d24db2141
This commit is contained in:
Valentin Shergin
2019-04-20 10:49:52 -07:00
committed by Facebook Github Bot
parent 0e72137c99
commit c257a57e8e

View File

@@ -33,6 +33,11 @@ void ComponentDescriptorRegistry::add(
_registryByHandle[componentDescriptorProvider.handle] =
sharedComponentDescriptor;
_registryByName[componentDescriptorProvider.name] = sharedComponentDescriptor;
if (componentDescriptorProvider.name == "UnimplementedNativeView") {
auto *self = const_cast<ComponentDescriptorRegistry *>(this);
self->setFallbackComponentDescriptor(sharedComponentDescriptor);
}
}
void ComponentDescriptorRegistry::remove(