@@ -20,7 +20,7 @@ import {
20
20
ForwardRef ,
21
21
} from 'shared/ReactWorkTags' ;
22
22
23
- const ReactCurrentOwner = ReactSharedInternals . ReactCurrentOwner ;
23
+ const ReactCurrentDispatcher = ReactSharedInternals . ReactCurrentDispatcher ;
24
24
25
25
// Used to track hooks called during a render
26
26
@@ -409,17 +409,17 @@ export function inspectHooks<Props>(
409
409
renderFunction : Props => React$Node ,
410
410
props : Props ,
411
411
) : HooksTree {
412
- let previousDispatcher = ReactCurrentOwner . currentDispatcher ;
412
+ let previousDispatcher = ReactCurrentDispatcher . current ;
413
413
let readHookLog ;
414
- ReactCurrentOwner . currentDispatcher = Dispatcher ;
414
+ ReactCurrentDispatcher . current = Dispatcher ;
415
415
let ancestorStackError ;
416
416
try {
417
417
ancestorStackError = new Error ( ) ;
418
418
renderFunction ( props ) ;
419
419
} finally {
420
420
readHookLog = hookLog ;
421
421
hookLog = [ ] ;
422
- ReactCurrentOwner . currentDispatcher = previousDispatcher ;
422
+ ReactCurrentDispatcher . current = previousDispatcher ;
423
423
}
424
424
let rootStack = ErrorStackParser . parse ( ancestorStackError ) ;
425
425
return buildTree ( rootStack , readHookLog ) ;
@@ -451,17 +451,17 @@ function inspectHooksOfForwardRef<Props, Ref>(
451
451
props : Props ,
452
452
ref : Ref ,
453
453
) : HooksTree {
454
- let previousDispatcher = ReactCurrentOwner . currentDispatcher ;
454
+ let previousDispatcher = ReactCurrentDispatcher . current ;
455
455
let readHookLog ;
456
- ReactCurrentOwner . currentDispatcher = Dispatcher ;
456
+ ReactCurrentDispatcher . current = Dispatcher ;
457
457
let ancestorStackError ;
458
458
try {
459
459
ancestorStackError = new Error ( ) ;
460
460
renderFunction ( props , ref ) ;
461
461
} finally {
462
462
readHookLog = hookLog ;
463
463
hookLog = [ ] ;
464
- ReactCurrentOwner . currentDispatcher = previousDispatcher ;
464
+ ReactCurrentDispatcher . current = previousDispatcher ;
465
465
}
466
466
let rootStack = ErrorStackParser.parse(ancestorStackError);
467
467
return buildTree(rootStack, readHookLog);
0 commit comments