Skip to content

Commit

Permalink
RuntimeScheduler is only used by TurboModule Manager in >RN0.72 (#2461)
Browse files Browse the repository at this point in the history
  • Loading branch information
shwanton authored Jun 16, 2023
1 parent 2eea361 commit 79615c9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-walls-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rnx-kit/react-native-host": patch
---

RuntimeScheduler is only used by TurboModule Manager in >RN0.72
12 changes: 12 additions & 0 deletions packages/react-native-host/cocoa/RNXTurboModuleAdapter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,21 @@
#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>)

#endif // USE_TURBOMODULE
Expand Down

0 comments on commit 79615c9

Please sign in to comment.