diff --git a/apple/REAModule.mm b/apple/REAModule.mm index 90d5d40186f5..714cc3b2f297 100644 --- a/apple/REAModule.mm +++ b/apple/REAModule.mm @@ -131,7 +131,11 @@ - (void)installReanimatedAfterReload - (void)handleJavaScriptDidLoadNotification:(NSNotification *)notification { - _surfacePresenter = self.bridge.surfacePresenter; + [self attachReactEventListener]; +} + +- (void)attachReactEventListener +{ RCTScheduler *scheduler = [_surfacePresenter scheduler]; __weak __typeof__(self) weakSelf = self; _surfacePresenter.runtimeExecutor(^(jsi::Runtime &runtime) { @@ -289,6 +293,7 @@ - (void)sendEventWithName:(NSString *)eventName body:(id)body }); auto nativeReanimatedModule = reanimated::createReanimatedModuleBridgeless( _moduleRegistry, rnRuntime, std::string([valueUnpackerCode UTF8String]), executorFunction); + [self attachReactEventListener]; [self commonInit:nativeReanimatedModule withRnRuntime:rnRuntime]; #else // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED) [NSException raise:@"Missing bridge" format:@"[Reanimated] Failed to obtain the bridge."];