mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Inject ReactCurrentDispatcher ref to DevTools (#14550)
This commit is contained in:
1 parent
19ef0ec116
commit
ab03e3d651
1 file changed
+4
@@ -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