Skip to content

Commit

Permalink
Fix double metro banner in Bridgeless (#43967)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Apr 8, 2024
1 parent f4a3deb commit 64ed820
Showing 1 changed file with 0 additions and 11 deletions.
Expand Up @@ -31,7 +31,6 @@
#import <React/RCTModuleData.h>
#import <React/RCTPerformanceLogger.h>
#import <React/RCTRedBox.h>
#import <React/RCTReloadCommand.h>
#import <React/RCTSurfacePresenter.h>
#import <ReactCommon/RCTTurboModuleManager.h>
#import <ReactCommon/RuntimeExecutor.h>
Expand Down Expand Up @@ -136,11 +135,6 @@ - (instancetype)initWithDelegate:(id<RCTInstanceDelegate>)delegate
name:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED"
object:nil];

[defaultCenter addObserver:self
selector:@selector(didReceiveReloadCommand)
name:RCTTriggerReloadCommandNotification
object:nil];

[self _start];
}
return self;
Expand Down Expand Up @@ -519,9 +513,4 @@ - (void)_handleJSError:(const JsErrorHandler::ParsedError &)error
isFatal:error.isFatal];
}

- (void)didReceiveReloadCommand
{
[self _loadJSBundle:[_bridgeModuleDecorator.bundleManager bundleURL]];
}

@end

0 comments on commit 64ed820

Please sign in to comment.