Skip to content

Commit e381e58

Browse files
committed
Rename internal fields
One day we'll use private fields for this but until then I'm just going to rename these every version until people get the hint.
1 parent 40568e9 commit e381e58

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import {getParentSuspenseInstance} from './ReactDOMHostConfig';
1818
const randomKey = Math.random()
1919
.toString(36)
2020
.slice(2);
21-
const internalInstanceKey = '__reactInternalInstance$' + randomKey;
22-
const internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
23-
const internalContainerInstanceKey = '__reactContainere$' + randomKey;
21+
const internalInstanceKey = '__reactFiber$' + randomKey;
22+
const internalEventHandlersKey = '__reactEvents$' + randomKey;
23+
const internalContainerInstanceKey = '__reactContainer$' + randomKey;
2424

2525
export function precacheFiberNode(hostInst, node) {
2626
node[internalInstanceKey] = hostInst;

packages/shared/ReactInstanceMap.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@
2121
* supported we can rename it.
2222
*/
2323
export function remove(key) {
24-
key._reactInternalFiber = undefined;
24+
key._reactInternals = undefined;
2525
}
2626

2727
export function get(key) {
28-
return key._reactInternalFiber;
28+
return key._reactInternals;
2929
}
3030

3131
export function has(key) {
32-
return key._reactInternalFiber !== undefined;
32+
return key._reactInternals !== undefined;
3333
}
3434

3535
export function set(key, value) {
36-
key._reactInternalFiber = value;
36+
key._reactInternals = value;
3737
}

0 commit comments

Comments
 (0)