From 3a68f14ac2b1c4d0de84c21dbe3f52e0764f29b4 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Thu, 31 Oct 2024 00:56:21 -0700 Subject: [PATCH] cleanup enabled_automatic_interop_android (#47321) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47321 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 fbshipit-source-id: d8b595edb6fecce05e67abc257d98805daa16a9a --- .../react/config/ReactNativeConfig.cpp | 3 --- .../ComponentDescriptorRegistry.cpp | 23 ++++--------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/packages/react-native/ReactCommon/react/config/ReactNativeConfig.cpp b/packages/react-native/ReactCommon/react/config/ReactNativeConfig.cpp index dbeae137424..7838f19c4c2 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 cbf6bcc1bd5..3c5487b240d 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 @@ -84,23 +83,11 @@ const ComponentDescriptor& ComponentDescriptorRegistry::at( } 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(); - } + auto componentDescriptor = std::make_shared< + const UnstableLegacyViewManagerAutomaticComponentDescriptor>( + parameters_, unifiedComponentName); + registerComponentDescriptor(componentDescriptor); + return *_registryByName.find(unifiedComponentName)->second; } return *it->second;