Skip to content

Commit ab03e3d

Browse files
authored
Inject ReactCurrentDispatcher ref to DevTools (#14550)
1 parent 19ef0ec commit ab03e3d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-reconciler/src/ReactFiberReconciler.js

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {HostComponent, ClassComponent} from 'shared/ReactWorkTags';
2727
import getComponentName from 'shared/getComponentName';
2828
import invariant from 'shared/invariant';
2929
import warningWithoutStack from 'shared/warningWithoutStack';
30+
import ReactSharedInternals from 'shared/ReactSharedInternals';
3031

3132
import {getPublicInstance} from './ReactFiberHostConfig';
3233
import {
@@ -380,9 +381,12 @@ if (__DEV__) {
380381

381382
export function injectIntoDevTools(devToolsConfig: DevToolsConfig): boolean {
382383
const {findFiberByHostInstance} = devToolsConfig;
384+
const {ReactCurrentDispatcher} = ReactSharedInternals;
385+
383386
return injectInternals({
384387
...devToolsConfig,
385388
overrideProps,
389+
currentDispatcherRef: ReactCurrentDispatcher,
386390
findHostInstanceByFiber(fiber: Fiber): Instance | TextInstance | null {
387391
const hostFiber = findCurrentHostFiber(fiber);
388392
if (hostFiber === null) {

0 commit comments

Comments
 (0)