File tree 1 file changed +14
-1
lines changed
packages/react-devtools-shared/src
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 9
9
10
10
import { unstable_getCacheForType as getCacheForType } from 'react' ;
11
11
import { enableHookNameParsing } from 'react-devtools-feature-flags' ;
12
+ import { __DEBUG__ } from 'react-devtools-shared/src/constants' ;
12
13
13
14
import type { HooksTree } from 'react-debug-tools/src/ReactDebugHooks' ;
14
15
import type { Thenable , Wakeable } from 'shared/ReactTypes' ;
@@ -108,6 +109,10 @@ export function loadHookNames(
108
109
return ;
109
110
}
110
111
112
+ if ( __DEBUG__ ) {
113
+ console . log ( '[hookNamesCache] onSuccess() hookNames:' , hookNames ) ;
114
+ }
115
+
111
116
if ( hookNames ) {
112
117
const resolvedRecord = ( ( newRecord : any ) : ResolvedRecord < HookNames > ) ;
113
118
resolvedRecord . status = Resolved ;
@@ -121,6 +126,10 @@ export function loadHookNames(
121
126
wake ( ) ;
122
127
} ,
123
128
function onError ( error ) {
129
+ if ( __DEBUG__ ) {
130
+ console . log ( '[hookNamesCache] onError() error:' , error ) ;
131
+ }
132
+
124
133
if ( didTimeout ) {
125
134
return ;
126
135
}
@@ -134,7 +143,11 @@ export function loadHookNames(
134
143
) ;
135
144
136
145
// Eventually timeout and stop trying to load names.
137
- let timeoutID = setTimeout ( ( ) => {
146
+ let timeoutID = setTimeout ( function onTimeout ( ) {
147
+ if ( __DEBUG__ ) {
148
+ console . log ( '[hookNamesCache] onTimeout()' ) ;
149
+ }
150
+
138
151
timeoutID = null ;
139
152
140
153
didTimeout = true ;
You can’t perform that action at this time.
0 commit comments