Skip to content

Commit 14132ef

Browse files
committed
Attach instance handle to DOM in DEV for enableInternalInstanceMap
1 parent d763f31 commit 14132ef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/react-dom-bindings/src/client/ReactDOMComponentTree.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ export function detachDeletedInstance(node: Instance): void {
7575
delete (node: any)[internalEventHandlerListenersKey];
7676
delete (node: any)[internalEventHandlesSetKey];
7777
delete (node: any)[internalRootNodeResourcesKey];
78+
if (__DEV__) {
79+
delete (node: any)[internalInstanceKey];
80+
}
7881
return;
7982
}
8083
// TODO: This function is only called on host components. I don't think all of
@@ -97,6 +100,9 @@ export function precacheFiberNode(
97100
): void {
98101
if (enableInternalInstanceMap) {
99102
internalInstanceMap.set(node, hostInst);
103+
if (__DEV__) {
104+
(node: any)[internalInstanceKey] = hostInst;
105+
}
100106
return;
101107
}
102108
(node: any)[internalInstanceKey] = hostInst;

0 commit comments

Comments
 (0)