Skip to content

Commit

Permalink
Migrate feature flag for automatic Fabric interop to new feature flag…
Browse files Browse the repository at this point in the history
… system

Summary: Changelog: [internal]

Differential Revision: D65062305
  • Loading branch information
rubennorte authored and facebook-github-bot committed Oct 28, 2024
1 parent ca56996 commit e1b5512
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ bool enableFabricRenderer() override
{
return true;
}
bool useFabricInterop() override
{
return true;
}
bool useTurboModules() override
{
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ target_link_libraries(react_render_componentregistry
folly_runtime
glog_init
jsi
react_config
react_debug
react_featureflags
react_render_core
react_render_debug
react_utils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "componentNameByReactViewName.h"

#include <react/config/ReactNativeConfig.h>
#include <react/debug/react_native_assert.h>
#include <react/featureflags/ReactNativeFeatureFlags.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.h>
#include <react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.h>
Expand Down Expand Up @@ -84,11 +84,7 @@ const ComponentDescriptor& ComponentDescriptorRegistry::at(
}

if (it == _registryByName.end()) {
auto reactNativeConfig_ =
contextContainer_->at<std::shared_ptr<const ReactNativeConfig>>(
"ReactNativeConfig");
if (reactNativeConfig_->getBool(
"react_fabric:enabled_automatic_interop_android")) {
if (ReactNativeFeatureFlags::useFabricInterop()) {
auto componentDescriptor = std::make_shared<
const UnstableLegacyViewManagerAutomaticComponentDescriptor>(
parameters_, unifiedComponentName);
Expand Down

0 comments on commit e1b5512

Please sign in to comment.