Skip to content

Commit

Permalink
Fix RCTRootView invalidation using the wrong bridge
Browse files Browse the repository at this point in the history
Reviewed By: majak

Differential Revision: D3696533

fbshipit-source-id: e7ef4373e975e585f4c34df71966c8b5b30d3e9a
  • Loading branch information
javache authored and Facebook Github Bot 1 committed Aug 10, 2016
1 parent 0cc3b4b commit 4afaf5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Libraries/Utilities/MessageQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ class MessageQueue {
const moduleMethods = this._callableModules[module];
invariant(
!!moduleMethods,
'Module %s is not a registered callable module.',
module
'Module %s is not a registered callable module (calling %s)',
module, method
);
invariant(
!!moduleMethods[method],
Expand Down
6 changes: 5 additions & 1 deletion React/Base/RCTRootView.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#import "RCTAssert.h"
#import "RCTBridge.h"
#import "RCTBridge+Private.h"
#import "RCTEventDispatcher.h"
#import "RCTKeyCommands.h"
#import "RCTLog.h"
Expand Down Expand Up @@ -92,7 +93,7 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge
object:self];

if (!_bridge.loading) {
[self bundleFinishedLoading:_bridge];
[self bundleFinishedLoading:[_bridge batchedBridge]];
}

[self showLoadingView];
Expand Down Expand Up @@ -199,6 +200,9 @@ - (void)bridgeDidReload
- (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];
}
Expand Down

0 comments on commit 4afaf5e

Please sign in to comment.