Skip to content

Commit

Permalink
RuntimeSchedule is only used in 0.72
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn Dempsey committed Jun 15, 2023
1 parent e790dce commit dca4803
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion packages/react-native-host/cocoa/RNXTurboModuleAdapter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,30 @@
#else
#import <React-RCTAppDelegate/RCTAppSetupUtils.h>
#import <React/RCTSurfacePresenterBridgeAdapter.h>

// We still get into this path because react-native-macos 0.71 picked up some
// 0.72 bits. AFAICT, `RCTLegacyInteropComponents.h` is a new addition in 0.72
// in both react-native and react-native-macos.
#if __has_include(<React-RCTAppDelegate/RCTLegacyInteropComponents.h>)
#import <react/renderer/runtimescheduler/RuntimeScheduler.h>
#import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
#if __has_include(<React/RCTRuntimeExecutorFromBridge.h>)
#import <React/RCTRuntimeExecutorFromBridge.h>
#endif // __has_include(<React/RCTRuntimeExecutorFromBridge.h>)
#define USE_RUNTIME_SCHEDULER 1
#else
#define USE_RUNTIME_SCHEDULER 0
#endif // __has_include(<React-RCTAppDelegate/RCTLegacyInteropComponents.h>)

#endif // __has_include(<React/RCTAppSetupUtils.h>)

// RCTAppSetupDefaultJsExecutorFactory is in different locations for iOS (0.71)/macOS(0.71)
#if !TARGET_OS_OSX
#import <React/RCTAppSetupUtils.h>
#else
#import <React-RCTAppDelegate/RCTAppSetupUtils.h>
#endif

#endif // USE_TURBOMODULE

@implementation RNXTurboModuleAdapter {
Expand All @@ -45,7 +64,7 @@ @implementation RNXTurboModuleAdapter {
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
delegate:self
jsInvoker:callInvoker];
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager, _runtimeScheduler);
#else
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
delegate:self
Expand Down

0 comments on commit dca4803

Please sign in to comment.