Skip to content

Commit

Permalink
refactor to use natural keys
Browse files Browse the repository at this point in the history
  • Loading branch information
gnoff committed Feb 14, 2023
1 parent 2291e1e commit f06ed57
Show file tree
Hide file tree
Showing 3 changed files with 248 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const internalEventHandlerListenersKey = '__reactListeners$' + randomKey;
const internalEventHandlesSetKey = '__reactHandles$' + randomKey;
const internalRootNodeResourcesKey = '__reactResources$' + randomKey;
const internalHoistableMarker = '__reactMarker$' + randomKey;
const internalCachedMarker = '__reactCacheMarker$' + randomKey;

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

export function isMarkedCached(node: Node): boolean {
return !!(node: any)[internalCachedMarker];
}

export function markNodeAsCached(node: Node) {
(node: any)[internalCachedMarker] = true;
}

export function isOwnedInstance(node: Node): boolean {
return !!(
(node: any)[internalHoistableMarker] || (node: any)[internalInstanceKey]
Expand Down
Loading

0 comments on commit f06ed57

Please sign in to comment.