add comments regarding RCTPackagerConnection's reconnect (#53558)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53558

Changelog: [Internal]
Got confused regarding why "reconnect" does not actually trigger a reconnect. It turns out, it only triggers a reconnect if the URL has changed.

Reviewed By: cipolleschi, huntie

Differential Revision: D80629308

fbshipit-source-id: 098ef5e91f3748deb9bc707b79bc0395d2442ca4
This commit is contained in:
Vitali Zaidman
2025-09-04 10:00:18 -07:00
committed by Facebook GitHub Bot
parent 0a3b3fcd18
commit 47f32ffae0
2 changed files with 2 additions and 1 deletions
@@ -59,7 +59,7 @@ typedef void (^RCTConnectedHandler)(void);
/** Disconnects and removes all handlers. */
- (void)stop;
/** Reconnect with given packager server. */
/** Reconnect with given packager server, if packagerServerHostPort has changed. */
- (void)reconnect:(NSString *)packagerServerHostPort;
/**
@@ -160,6 +160,7 @@ static RCTReconnectingWebSocket *socketForLocation(NSString *const serverHostPor
- (void)bundleURLSettingsChanged
{
// Will only reconnect if `packagerServerHostPort` has actually changed
[self reconnect:[[RCTBundleURLProvider sharedSettings] packagerServerHostPort]];
}