mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 11:57:46 +08:00
Fix RCTRootView invalidation using the wrong bridge
Reviewed By: majak Differential Revision: D3696533 fbshipit-source-id: e7ef4373e975e585f4c34df71966c8b5b30d3e9a
This commit is contained in:
committed by
Facebook Github Bot 1
parent
0cc3b4b079
commit
4afaf5e538
@@ -15,6 +15,7 @@
|
||||
|
||||
#import "RCTAssert.h"
|
||||
#import "RCTBridge.h"
|
||||
#import "RCTBridge+Private.h"
|
||||
#import "RCTEventDispatcher.h"
|
||||
#import "RCTKeyCommands.h"
|
||||
#import "RCTLog.h"
|
||||
@@ -92,7 +93,7 @@ NSString *const RCTContentDidAppearNotification = @"RCTContentDidAppearNotificat
|
||||
object:self];
|
||||
|
||||
if (!_bridge.loading) {
|
||||
[self bundleFinishedLoading:_bridge];
|
||||
[self bundleFinishedLoading:[_bridge batchedBridge]];
|
||||
}
|
||||
|
||||
[self showLoadingView];
|
||||
@@ -199,6 +200,9 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
|
||||
- (void)javaScriptDidLoad:(NSNotification *)notification
|
||||
{
|
||||
RCTAssertMainQueue();
|
||||
|
||||
// Use the (batched) bridge that's sent in the notification payload, so the
|
||||
// RCTRootContentView is scoped to the right bridge
|
||||
RCTBridge *bridge = notification.userInfo[@"bridge"];
|
||||
[self bundleFinishedLoading:bridge];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user