MCPcopy Create free account
hub / github.com/danielstocks/react-sortable / commitDeletion

Function commitDeletion

bundle.js:7586–7593  ·  view source on GitHub ↗
(current)

Source from the content-addressed store, hash-verified

7584if(node.child!==null){node.child['return']=node;node=node.child;continue;}}if(node===current){return;}while(node.sibling===null){if(node['return']===null||node['return']===current){return;}node=node['return'];if(node.tag===HostPortal$7){// When we go out of the portal, we need to restore the parent.
7585// Since we don't keep a stack of them, we will search for it.
7586currentParentIsValid=false;}}node.sibling['return']=node['return'];node=node.sibling;}}function commitDeletion(current){// Recursively delete all host nodes from the parent.
7587// Detach refs and call componentWillUnmount() on the whole subtree.
7588unmountHostComponents(current);// Cut off the return pointers to disconnect it from the tree. Ideally, we
7589// should clear the child pointer of the parent alternate to let this
7590// get GC:ed but we don't know which for sure which parent is the current
7591// one so we'll settle for GC:ing the subtree of this child. This child
7592// itself will be GC:ed when the parent updates the next time.
7593current['return']=null;current.child=null;if(current.alternate){current.alternate.child=null;current.alternate['return']=null;}}// User-originating errors (lifecycles and refs) should not interrupt
7594// deletion, so don't let them throw. Host-originating errors should
7595// interrupt deletion, so it's okay
7596function commitUnmount(current){if(typeof onCommitUnmount==='function'){onCommitUnmount(current);}switch(current.tag){case ClassComponent$9:{safelyDetachRef(current);var instance=current.stateNode;if(typeof instance.componentWillUnmount==='function'){safelyCallComponentWillUnmount(current,instance);}return;}case HostComponent$9:{safelyDetachRef(current);return;}case CoroutineComponent$4:{commitNestedUnmounts(current.stateNode);return;}case HostPortal$7:{// TODO: this is recursive.

Callers 1

commitAllHostEffectsFunction · 0.85

Calls 1

unmountHostComponentsFunction · 0.85

Tested by

no test coverage detected