From d41bcb30f4f3101397b3186121890946b71374c4 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 30 Oct 2024 17:51:07 -0700 Subject: [PATCH] cleanup enabled_automatic_interop_android (#47321) Summary: Changelog: [Internal] this seems to be the last callsite where we read the ReactNativeConfig from the contextContainer. i don't think this killswitch should block cleanup of the ReactNativeConfig, so maybe we can just remove this? Reviewed By: cortinico Differential Revision: D65192744 --- .../react/config/ReactNativeConfig.cpp | 3 --- .../ComponentDescriptorRegistry.cpp | 27 +++++-------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/packages/react-native/ReactCommon/react/config/ReactNativeConfig.cpp b/packages/react-native/ReactCommon/react/config/ReactNativeConfig.cpp index dbeae137424e88..7838f19c4c2384 100644 --- a/packages/react-native/ReactCommon/react/config/ReactNativeConfig.cpp +++ b/packages/react-native/ReactCommon/react/config/ReactNativeConfig.cpp @@ -10,9 +10,6 @@ namespace facebook::react { bool EmptyReactNativeConfig::getBool(const std::string& param) const { - if (param == "react_fabric:enabled_automatic_interop_android") { - return true; - } return false; } diff --git a/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp b/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp index cbf6bcc1bd506f..e2f2e10f4283e6 100644 --- a/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +++ b/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp @@ -9,7 +9,6 @@ #include "componentNameByReactViewName.h" -#include #include #include #include @@ -83,25 +82,13 @@ const ComponentDescriptor& ComponentDescriptorRegistry::at( // assert(it != _registryByName.end()); } - if (it == _registryByName.end()) { - auto reactNativeConfig_ = - contextContainer_->at>( - "ReactNativeConfig"); - if (reactNativeConfig_->getBool( - "react_fabric:enabled_automatic_interop_android")) { - auto componentDescriptor = std::make_shared< - const UnstableLegacyViewManagerAutomaticComponentDescriptor>( - parameters_, unifiedComponentName); - registerComponentDescriptor(componentDescriptor); - return *_registryByName.find(unifiedComponentName)->second; - } else if (_fallbackComponentDescriptor == nullptr) { - throw std::invalid_argument( - ("Unable to find componentDescriptor for " + unifiedComponentName) - .c_str()); - } else { - return *_fallbackComponentDescriptor.get(); - } - } + if (it == _registryByName.end()) { + auto componentDescriptor = std::make_shared< + const UnstableLegacyViewManagerAutomaticComponentDescriptor>( + parameters_, unifiedComponentName); + registerComponentDescriptor(componentDescriptor); + return *_registryByName.find(unifiedComponentName)->second; + } return *it->second; }