Skip to content

Commit f2d5008

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Fix double metro banner in Bridgeless (#43967)
Summary: 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
1 parent 8c3f8b6 commit f2d5008

File tree

1 file changed

+0
-11
lines changed
  • packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon

1 file changed

+0
-11
lines changed

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)