Skip to content

Commit

Permalink
Inject ReactCurrentDispatcher ref to DevTools (#14550)
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn authored Jan 9, 2019
1 parent 19ef0ec commit ab03e3d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-reconciler/src/ReactFiberReconciler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ab03e3d

Please sign in to comment.