mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
0a3b3fcd18
commit
47f32ffae0
@@ -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]];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user