Skip to content

Commit b3c51d1

Browse files
committed
Fix devtools injection
1 parent d2eb352 commit b3c51d1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/react-reconciler/src/ReactFiberReconciler.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,11 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
521521
return ReactFiberDevToolsHook.injectInternals({
522522
...devToolsConfig,
523523
findHostInstanceByFiber(fiber: Fiber): I | TI | null {
524-
return findHostInstance(fiber);
524+
const hostFiber = findCurrentHostFiber(fiber);
525+
if (hostFiber === null) {
526+
return null;
527+
}
528+
return hostFiber.stateNode;
525529
},
526530
findFiberByHostInstance(instance: I | TI): Fiber | null {
527531
if (!findFiberByHostInstance) {

0 commit comments

Comments
 (0)