Create gating to route all TurboModules through interop (#37153)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37153

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D45329538

fbshipit-source-id: b79ef27544695dfc1cd6c25622c1971e151863d2
This commit is contained in:
Ramanpreet Nara
2023-04-30 03:28:33 -07:00
committed by Facebook GitHub Bot
parent 2a8e1e0137
commit 1395ed29ae
2 changed files with 14 additions and 0 deletions
@@ -60,6 +60,10 @@ RCT_EXTERN void RCTDisableTurboModuleManagerDelegateLocking(BOOL enabled);
RCT_EXTERN BOOL RCTTurboModuleInteropEnabled(void);
RCT_EXTERN void RCTEnableTurboModuleInterop(BOOL enabled);
// Route all TurboModules through TurboModule interop
RCT_EXTERN BOOL RCTTurboModuleInteropForAllTurboModulesEnabled(void);
RCT_EXTERN void RCTEnableTurboModuleInteropForAllTurboModules(BOOL enabled);
typedef enum {
kRCTGlobalScope,
kRCTGlobalScopeUsingRetainJSCallback,
@@ -130,6 +130,16 @@ void RCTEnableTurboModuleInterop(BOOL enabled)
turboModuleInteropEnabled = enabled;
}
static BOOL useTurboModuleInteropForAllTurboModules = NO;
BOOL RCTTurboModuleInteropForAllTurboModulesEnabled(void)
{
return useTurboModuleInteropForAllTurboModules;
}
void RCTEnableTurboModuleInteropForAllTurboModules(BOOL enabled)
{
useTurboModuleInteropForAllTurboModules = enabled;
}
@interface RCTBridge () <RCTReloadListener>
@end