Skip to content

Commit 64ed820

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Fix double metro banner in Bridgeless (#43967)
Summary: Pull Request resolved: #43967 Following up #43943, the metro loading banner is presented twice in Bridgeless mode. This happens because both the RCTInstance and the RCTHost are listening to the Reload Command and issuing the instructions to refetch the JSBundle and to present the banner. The RCTInstance should not concern itself with lifecycle events, owned by the RCTHost. ## Changelog: [iOS][Fixed] - Avoid to show Metro Loading banner twice. Reviewed By: cortinico Differential Revision: D55870640 fbshipit-source-id: addb67d3226f7d7db20736309172a42fc15f3aa3
1 parent f4a3deb commit 64ed820

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

  • packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#import <React/RCTModuleData.h>
3232
#import <React/RCTPerformanceLogger.h>
3333
#import <React/RCTRedBox.h>
34-
#import <React/RCTReloadCommand.h>
3534
#import <React/RCTSurfacePresenter.h>
3635
#import <ReactCommon/RCTTurboModuleManager.h>
3736
#import <ReactCommon/RuntimeExecutor.h>
@@ -136,11 +135,6 @@ - (instancetype)initWithDelegate:(id<RCTInstanceDelegate>)delegate
136135
name:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED"
137136
object:nil];
138137

139-
[defaultCenter addObserver:self
140-
selector:@selector(didReceiveReloadCommand)
141-
name:RCTTriggerReloadCommandNotification
142-
object:nil];
143-
144138
[self _start];
145139
}
146140
return self;
@@ -519,9 +513,4 @@ - (void)_handleJSError:(const JsErrorHandler::ParsedError &)error
519513
isFatal:error.isFatal];
520514
}
521515

522-
- (void)didReceiveReloadCommand
523-
{
524-
[self _loadJSBundle:[_bridgeModuleDecorator.bundleManager bundleURL]];
525-
}
526-
527516
@end

0 commit comments

Comments
 (0)