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:
2424* ` useHttps: boolean ` (defaults to ` false ` ) - Websocked should use a secure protocol (wss).
2525* ` websocket: Websocket ` - Custom websocket to use. Overrides ` host ` and ` port ` settings if provided.
2626* ` 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.
2728* ` isAppActive: () => boolean ` - If provided, DevTools will poll this method and wait until it returns true before connecting to React.
2829
2930## ` react-devtools-core/standalone `
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ type ConnectOptions = {
2626 port ?: number ,
2727 useHttps ?: boolean ,
2828 resolveRNStyle ?: ResolveNativeStyle ,
29+ retryConnectionDelay ?: number ,
2930 isAppActive ?: ( ) => boolean ,
3031 websocket ?: ?WebSocket ,
3132 ...
@@ -60,6 +61,7 @@ export function connectToDevTools(options: ?ConnectOptions) {
6061 port = 8097 ,
6162 websocket,
6263 resolveRNStyle = null ,
64+ retryConnectionDelay = 2000 ,
6365 isAppActive = ( ) => true ,
6466 } = options || { } ;
6567
@@ -69,7 +71,10 @@ export function connectToDevTools(options: ?ConnectOptions) {
6971 function scheduleRetry ( ) {
7072 if ( retryTimeoutID === null ) {
7173 // Two seconds because RN had issues with quick retries.
72- retryTimeoutID = setTimeout ( ( ) => connectToDevTools ( options ) , 2000 ) ;
74+ retryTimeoutID = setTimeout (
75+ ( ) => connectToDevTools ( options ) ,
76+ retryConnectionDelay ,
77+ ) ;
7378 }
7479 }
7580
You can’t perform that action at this time.
0 commit comments