Skip to content

Commit

Permalink
Include native module for ReactNativeFeatureFlags by default in all a…
Browse files Browse the repository at this point in the history
…pps using TurboModules

Differential Revision: D52905704

fbshipit-source-id: 38ff83bcb721eaa6cb87f3457e0bddb3dd5077c5
  • Loading branch information
rubennorte authored and facebook-github-bot committed Jan 20, 2024
1 parent 2d01108 commit 2452251
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <algorithm>

#include <RCTFeatureFlags/NativeReactNativeFeatureFlags.h>
#include <rncore.h>

namespace facebook::react {
Expand Down Expand Up @@ -67,8 +68,16 @@ std::shared_ptr<TurboModule> DefaultTurboModuleManagerDelegate::getTurboModule(

auto moduleProvider = DefaultTurboModuleManagerDelegate::cxxModuleProvider;
if (moduleProvider) {
return moduleProvider(name, jsInvoker);
auto module = moduleProvider(name, jsInvoker);
if (module) {
return module;
}
}

if (name == NativeReactNativeFeatureFlags::kModuleName) {
return std::make_shared<NativeReactNativeFeatureFlags>(jsInvoker);
}

return nullptr;
}

Expand Down

0 comments on commit 2452251

Please sign in to comment.