@samitouri / QOS-React / commits / 2ba43edc26

Rename internal fields (#18377)

Dan Abramov committed Mar 24, 2020 at 18:19 UTC 2ba43edc2675380a0f2222f351475bf9d750c6a9
2 files changed +8 -8
packages/react-dom/src/client/ReactDOMComponentTree.js
+4 -4
@@ -30,10 +30,10 @@ import {getParentSuspenseInstance} from './ReactDOMHostConfig';
30 const randomKey = Math.random()
31 .toString(36)
32 .slice(2);
33 -const internalInstanceKey = '__reactInternalInstance$' + randomKey;
34 -const internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
35 -const internalContainerInstanceKey = '__reactContainere$' + randomKey;
36 -const internalEventListenersKey = '__reactEventListeners$' + randomKey;
33 +const internalInstanceKey = '__reactFiber$' + randomKey;
34 +const internalEventHandlersKey = '__reactEvents$' + randomKey;
35 +const internalContainerInstanceKey = '__reactContainer$' + randomKey;
36 +const internalEventListenersKey = '__reactListeners$' + randomKey;
37
38 export function precacheFiberNode(
39 hostInst: Fiber,
packages/shared/ReactInstanceMap.js
+4 -4
@@ -21,17 +21,17 @@
21 * supported we can rename it.
22 */
23 export function remove(key) {
24 - key._reactInternalFiber = undefined;
24 + key._reactInternals = undefined;
25 }
26
27 export function get(key) {
28 - return key._reactInternalFiber;
28 + return key._reactInternals;
29 }
30
31 export function has(key) {
32 - return key._reactInternalFiber !== undefined;
32 + return key._reactInternals !== undefined;
33 }
34
35 export function set(key, value) {
36 - key._reactInternalFiber = value;
36 + key._reactInternals = value;
37 }