diff --git a/.changeset/fix-script-manager-rn-089-callinvoker.md b/.changeset/fix-script-manager-rn-089-callinvoker.md new file mode 100644 index 000000000..97880b5a0 --- /dev/null +++ b/.changeset/fix-script-manager-rn-089-callinvoker.md @@ -0,0 +1,5 @@ +--- +"@callstack/repack": patch +--- + +fix(ios): compile `ScriptManager` on React Native 0.89 by declaring `jsCallInvoker` on `RCTBridge` in a Re.Pack-specific category, so the declaration is available on the new architecture after RN 0.89 removed it from `RCTTurboModule.h`. diff --git a/packages/repack/ios/ScriptManager.mm b/packages/repack/ios/ScriptManager.mm index 1dc10e696..4e79d079e 100644 --- a/packages/repack/ios/ScriptManager.mm +++ b/packages/repack/ios/ScriptManager.mm @@ -17,11 +17,16 @@ @interface RCTBridge (JSIRuntime) - (void *)runtime; @end -#ifndef RCT_NEW_ARCH_ENABLED -@interface RCTBridge (RCTTurboModule) +// Declare jsCallInvoker ourselves on both architectures. Up to RN 0.88 the new +// architecture got this declaration from RCTBridge (RCTTurboModule) in +// ReactCommon/RCTTurboModule.h; RN 0.89 removed it, which broke new-architecture +// builds with "property 'jsCallInvoker' not found on object of type 'RCTBridge *'". +// A Re.Pack-specific category name avoids duplicating RN's own category on older +// versions, in the same way as the JSIRuntime category above. The method itself is +// still implemented by RN at runtime. +@interface RCTBridge (JSICallInvoker) - (std::shared_ptr)jsCallInvoker; @end -#endif static NSURLSession * (^_urlSessionFactory)(void) = nil; static NSURLSession *_cachedURLSession = nil;