mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Document logic implemented in ComponentDescriptorRegistry when a component is not found (#51062)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51062 Document logic implemented in ComponentDescriptorRegistry when a component is not found changelog: [internal] internal Reviewed By: arushikesarwani94, cortinico Differential Revision: D74036572 fbshipit-source-id: 20a5d182e0308538cdfa3f5e97957d488f010f0d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5ae6f6be25
commit
8c231b7d81
+9
@@ -85,12 +85,21 @@ const ComponentDescriptor& ComponentDescriptorRegistry::at(
|
||||
|
||||
if (it == _registryByName.end()) {
|
||||
if (ReactNativeFeatureFlags::useFabricInterop()) {
|
||||
// When interop is enabled, if the component is not found we rely on
|
||||
// UnstableLegacyViewManagerAutomaticComponentDescriptor to support legacy
|
||||
// components in new architecture.
|
||||
auto componentDescriptor = std::make_shared<
|
||||
const UnstableLegacyViewManagerAutomaticComponentDescriptor>(
|
||||
parameters_, unifiedComponentName);
|
||||
registerComponentDescriptor(componentDescriptor);
|
||||
return *_registryByName.find(unifiedComponentName)->second;
|
||||
} else {
|
||||
// When interop is disabled, if the component is not found we rely on
|
||||
// fallbackComponentDescriptor (default:
|
||||
// UnimplementedNativeViewComponentDescriptor).
|
||||
// UnimplementedNativeViewComponentDescriptor displays a View in debug
|
||||
// mode to alert the developer that the component is not properly
|
||||
// configured, and an empty view in release mode.
|
||||
if (_fallbackComponentDescriptor == nullptr) {
|
||||
throw std::invalid_argument(
|
||||
("Unable to find componentDescriptor for " + unifiedComponentName)
|
||||
|
||||
Reference in New Issue
Block a user