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: 171a783dfd36953472da9b1a3ba4ef33fbff0019
  • Loading branch information
rubennorte authored and facebook-github-bot committed Jan 20, 2024
1 parent 6125ee3 commit ca94db1
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 ca94db1

Please sign in to comment.