Skip to content

Commit 47f32ff

Browse files
vzaidmanfacebook-github-bot
authored andcommitted
add comments regarding RCTPackagerConnection's reconnect (#53558)
Summary: Pull Request resolved: #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
1 parent 0a3b3fc commit 47f32ff

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

packages/react-native/React/DevSupport/RCTPackagerConnection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ typedef void (^RCTConnectedHandler)(void);
5959
/** Disconnects and removes all handlers. */
6060
- (void)stop;
6161

62-
/** Reconnect with given packager server. */
62+
/** Reconnect with given packager server, if packagerServerHostPort has changed. */
6363
- (void)reconnect:(NSString *)packagerServerHostPort;
6464

6565
/**

packages/react-native/React/DevSupport/RCTPackagerConnection.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ - (void)reconnect:(NSString *)packagerServerHostPort
160160

161161
- (void)bundleURLSettingsChanged
162162
{
163+
// Will only reconnect if `packagerServerHostPort` has actually changed
163164
[self reconnect:[[RCTBundleURLProvider sharedSettings] packagerServerHostPort]];
164165
}
165166

0 commit comments

Comments
 (0)