Skip to content

Commit e45a78b

Browse files
committed
Fix iOS call
1 parent 336f1fc commit e45a78b

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

ios/RNMultithreading.mm

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#import <RNReanimated/REAIOSScheduler.h>
1111
#import <RNReanimated/REAIOSErrorHandler.h>
12+
#import "MakeJSIRuntime.h"
1213

1314
using namespace facebook;
1415

@@ -32,11 +33,21 @@ - (void)setBridge:(RCTBridge *)bridge
3233
}
3334

3435
auto callInvoker = bridge.jsCallInvoker;
35-
mrousavy::multithreading::install(*(jsi::Runtime *)cxxBridge.runtime, [callInvoker]() {
36+
37+
auto makeRuntime = []() -> std::unique_ptr<jsi::Runtime> {
38+
return mrousavy::multithreading::makeJSIRuntime();
39+
};
40+
auto makeScheduler = [callInvoker]() -> std::shared_ptr<reanimated::Scheduler> {
3641
return std::make_shared<reanimated::REAIOSScheduler>(callInvoker);
37-
}, [](std::shared_ptr<reanimated::Scheduler> scheduler) {
42+
};
43+
auto makeErrorHandler = [](std::shared_ptr<reanimated::Scheduler> scheduler) -> std::shared_ptr<reanimated::ErrorHandler> {
3844
return std::make_shared<reanimated::REAIOSErrorHandler>(scheduler);
39-
});
45+
};
46+
47+
mrousavy::multithreading::install(*(jsi::Runtime *)cxxBridge.runtime,
48+
makeRuntime,
49+
makeScheduler,
50+
makeErrorHandler);
4051
}
4152

4253
@end

0 commit comments

Comments
 (0)