@@ -20,7 +20,7 @@ import {
2020 ForwardRef ,
2121} from 'shared/ReactWorkTags' ;
2222
23- const ReactCurrentOwner = ReactSharedInternals . ReactCurrentOwner ;
23+ const ReactCurrentDispatcher = ReactSharedInternals . ReactCurrentDispatcher ;
2424
2525// Used to track hooks called during a render
2626
@@ -409,17 +409,17 @@ export function inspectHooks<Props>(
409409 renderFunction : Props => React$Node ,
410410 props : Props ,
411411) : HooksTree {
412- let previousDispatcher = ReactCurrentOwner . currentDispatcher ;
412+ let previousDispatcher = ReactCurrentDispatcher . current ;
413413 let readHookLog ;
414- ReactCurrentOwner . currentDispatcher = Dispatcher ;
414+ ReactCurrentDispatcher . current = Dispatcher ;
415415 let ancestorStackError ;
416416 try {
417417 ancestorStackError = new Error ( ) ;
418418 renderFunction ( props ) ;
419419 } finally {
420420 readHookLog = hookLog ;
421421 hookLog = [ ] ;
422- ReactCurrentOwner . currentDispatcher = previousDispatcher ;
422+ ReactCurrentDispatcher . current = previousDispatcher ;
423423 }
424424 let rootStack = ErrorStackParser . parse ( ancestorStackError ) ;
425425 return buildTree ( rootStack , readHookLog ) ;
@@ -451,17 +451,17 @@ function inspectHooksOfForwardRef<Props, Ref>(
451451 props : Props ,
452452 ref : Ref ,
453453) : HooksTree {
454- let previousDispatcher = ReactCurrentOwner . currentDispatcher ;
454+ let previousDispatcher = ReactCurrentDispatcher . current ;
455455 let readHookLog ;
456- ReactCurrentOwner . currentDispatcher = Dispatcher ;
456+ ReactCurrentDispatcher . current = Dispatcher ;
457457 let ancestorStackError ;
458458 try {
459459 ancestorStackError = new Error ( ) ;
460460 renderFunction ( props , ref ) ;
461461 } finally {
462462 readHookLog = hookLog ;
463463 hookLog = [ ] ;
464- ReactCurrentOwner . currentDispatcher = previousDispatcher ;
464+ ReactCurrentDispatcher . current = previousDispatcher ;
465465 }
466466 let rootStack = ErrorStackParser.parse(ancestorStackError);
467467 return buildTree(rootStack, readHookLog);
0 commit comments