diff --git a/React/Base/RCTBridge+Private.h b/React/Base/RCTBridge+Private.h index e3f015624..46f735a83 100644 --- a/React/Base/RCTBridge+Private.h +++ b/React/Base/RCTBridge+Private.h @@ -79,6 +79,12 @@ RCT_EXTERN void RCTVerifyAllModulesExported(NSArray *extraModules); */ @property (nonatomic, weak, readonly) id javaScriptExecutor; +/** + * Used by RCTModuleData + */ + +@property (nonatomic, weak, readonly) RCTBridge *parentBridge; + /** * Used by RCTModuleData */ diff --git a/React/Base/RCTModuleData.mm b/React/Base/RCTModuleData.mm index 69d367f2c..4db8ea6df 100644 --- a/React/Base/RCTModuleData.mm +++ b/React/Base/RCTModuleData.mm @@ -163,7 +163,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init); [_bridge registerModuleForFrameUpdates:_instance withModuleData:self]; [[NSNotificationCenter defaultCenter] postNotificationName:RCTDidInitializeModuleNotification object:_bridge - userInfo:@{@"module": _instance}]; + userInfo:@{@"module": _instance, @"bridge": RCTNullIfNil(_bridge.parentBridge)}]; RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @""); } }