Skip to content

Commit

Permalink
Fix double metro banner in Bridgeless
Browse files Browse the repository at this point in the history
Summary:
Following up facebook#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
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Apr 8, 2024
1 parent 3a15af7 commit df82b74
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
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 df82b74

Please sign in to comment.