mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Inject ReactCurrentDispatcher ref to DevTools (#14550)
This commit is contained in:
@@ -27,6 +27,7 @@ import {HostComponent, ClassComponent} from 'shared/ReactWorkTags';
|
||||
import getComponentName from 'shared/getComponentName';
|
||||
import invariant from 'shared/invariant';
|
||||
import warningWithoutStack from 'shared/warningWithoutStack';
|
||||
import ReactSharedInternals from 'shared/ReactSharedInternals';
|
||||
|
||||
import {getPublicInstance} from './ReactFiberHostConfig';
|
||||
import {
|
||||
@@ -380,9 +381,12 @@ if (__DEV__) {
|
||||
|
||||
export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
|
||||
const {findFiberByHostInstance} = devToolsConfig;
|
||||
const {ReactCurrentDispatcher} = ReactSharedInternals;
|
||||
|
||||
return injectInternals({
|
||||
...devToolsConfig,
|
||||
overrideProps,
|
||||
currentDispatcherRef: ReactCurrentDispatcher,
|
||||
findHostInstanceByFiber(fiber: Fiber): Instance | TextInstance | null {
|
||||
const hostFiber = findCurrentHostFiber(fiber);
|
||||
if (hostFiber === null) {
|
||||
|
||||
Reference in New Issue
Block a user