Check that RCTDidInitializeModuleNotification is being called with the correct bridge

Reviewed By: javache

Differential Revision: D4800110

fbshipit-source-id: acc8bc512ed17a84abeac74afb91db51ab4c5043
This commit is contained in:
Alex Dvornikov 2017-04-06 00:40:27 -07:00 committed by Facebook Github Bot
parent fd99330b6c
commit b3872e807d
2 changed files with 7 additions and 1 deletions

View File

@ -79,6 +79,12 @@ RCT_EXTERN void RCTVerifyAllModulesExported(NSArray *extraModules);
*/
@property (nonatomic, weak, readonly) id<RCTJavaScriptExecutor> javaScriptExecutor;
/**
* Used by RCTModuleData
*/
@property (nonatomic, weak, readonly) RCTBridge *parentBridge;
/**
* Used by RCTModuleData
*/

View File

@ -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, @"");
}
}