File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
packages/react-devtools-core Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ The `config` object may contain:
24
24
* ` useHttps: boolean ` (defaults to ` false ` ) - Websocked should use a secure protocol (wss).
25
25
* ` websocket: Websocket ` - Custom websocket to use. Overrides ` host ` and ` port ` settings if provided.
26
26
* ` resolveRNStyle: (style: number) => ?Object ` - Used by the React Native style plug-in.
27
+ * ` retryConnectionDelay: number ` (defaults to ` 2000 ` ) - Milliseconds delay to wait between retrying a failed Websocket connection.
27
28
* ` isAppActive: () => boolean ` - If provided, DevTools will poll this method and wait until it returns true before connecting to React.
28
29
29
30
## ` react-devtools-core/standalone `
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ type ConnectOptions = {
26
26
port ?: number ,
27
27
useHttps ?: boolean ,
28
28
resolveRNStyle ?: ResolveNativeStyle ,
29
+ retryConnectionDelay ?: number ,
29
30
isAppActive ?: ( ) => boolean ,
30
31
websocket ?: ?WebSocket ,
31
32
...
@@ -60,6 +61,7 @@ export function connectToDevTools(options: ?ConnectOptions) {
60
61
port = 8097 ,
61
62
websocket,
62
63
resolveRNStyle = null ,
64
+ retryConnectionDelay = 2000 ,
63
65
isAppActive = ( ) => true ,
64
66
} = options || { } ;
65
67
@@ -69,7 +71,10 @@ export function connectToDevTools(options: ?ConnectOptions) {
69
71
function scheduleRetry ( ) {
70
72
if ( retryTimeoutID === null ) {
71
73
// Two seconds because RN had issues with quick retries.
72
- retryTimeoutID = setTimeout ( ( ) => connectToDevTools ( options ) , 2000 ) ;
74
+ retryTimeoutID = setTimeout (
75
+ ( ) => connectToDevTools ( options ) ,
76
+ retryConnectionDelay ,
77
+ ) ;
73
78
}
74
79
}
75
80
You can’t perform that action at this time.
0 commit comments