Skip to content

Commit c01de8c

Browse files
committed
refactor to use natural keys
1 parent 6c07538 commit c01de8c

File tree

3 files changed

+248
-165
lines changed

3 files changed

+248
-165
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const internalEventHandlerListenersKey = '__reactListeners$' + randomKey;
4848
const internalEventHandlesSetKey = '__reactHandles$' + randomKey;
4949
const internalRootNodeResourcesKey = '__reactResources$' + randomKey;
5050
const internalHoistableMarker = '__reactMarker$' + randomKey;
51+
const internalCachedMarker = '__reactCacheMarker$' + randomKey;
5152

5253
export function detachDeletedInstance(node: Instance): void {
5354
// TODO: This function is only called on host components. I don't think all of
@@ -296,6 +297,14 @@ export function markNodeAsHoistable(node: Node) {
296297
(node: any)[internalHoistableMarker] = true;
297298
}
298299

300+
export function isMarkedCached(node: Node): boolean {
301+
return !!(node: any)[internalCachedMarker];
302+
}
303+
304+
export function markNodeAsCached(node: Node) {
305+
(node: any)[internalCachedMarker] = true;
306+
}
307+
299308
export function isOwnedInstance(node: Node): boolean {
300309
return !!(
301310
(node: any)[internalHoistableMarker] || (node: any)[internalInstanceKey]

0 commit comments

Comments
 (0)