MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / commitUnmount

Function commitUnmount

code/composition/public/app.js:11567–11605  ·  view source on GitHub ↗
(current)

Source from the content-addressed store, hash-verified

11565 // deletion, so don't let them throw. Host-originating errors should
11566 // interrupt deletion, so it's okay
11567 function commitUnmount(current) {
11568 if (typeof onCommitUnmount === 'function') {
11569 onCommitUnmount(current);
11570 }
11571
11572 switch (current.tag) {
11573 case ClassComponent:
11574 {
11575 safelyDetachRef(current);
11576 var _instance6 = current.stateNode;
11577 if (typeof _instance6.componentWillUnmount === 'function') {
11578 safelyCallComponentWillUnmount(current, _instance6);
11579 }
11580 return;
11581 }
11582 case HostComponent:
11583 {
11584 safelyDetachRef(current);
11585 return;
11586 }
11587 case CallComponent:
11588 {
11589 commitNestedUnmounts(current.stateNode);
11590 return;
11591 }
11592 case HostPortal:
11593 {
11594 // TODO: this is recursive.
11595 // We are also not using this parent because
11596 // the portal will get pushed immediately.
11597 if (enableMutatingReconciler && mutation) {
11598 unmountHostComponents(current);
11599 } else if (enablePersistentReconciler && persistence) {
11600 emptyPortalContainer(current);
11601 }
11602 return;
11603 }
11604 }
11605 }
11606
11607 function commitNestedUnmounts(root) {
11608 // While we're inside a removed host node we don't want to call

Callers 2

commitNestedUnmountsFunction · 0.70
unmountHostComponentsFunction · 0.70

Calls 5

onCommitUnmountFunction · 0.70
safelyDetachRefFunction · 0.70
commitNestedUnmountsFunction · 0.70
unmountHostComponentsFunction · 0.70

Tested by

no test coverage detected