Skip to content

Commit eade0d0

Browse files
authored
Attach instance handle to DOM in DEV for enableInternalInstanceMap (#35341)
Continue attaching `internalInstanceKey` to DOM nodes in DEV. This prevents breaking some internal dev tooling while we experiment with the broader change. Note that this does not reference the DOM handle within the flag, just attaches it and deletes it. Internals tracking is still done through the private map.
1 parent d763f31 commit eade0d0

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)