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

Function commitUnmount

code/redux/public/app.js:11680–11718  ·  view source on GitHub ↗
(current)

Source from the content-addressed store, hash-verified

11678 // deletion, so don't let them throw. Host-originating errors should
11679 // interrupt deletion, so it's okay
11680 function commitUnmount(current) {
11681 if (typeof onCommitUnmount === 'function') {
11682 onCommitUnmount(current);
11683 }
11684
11685 switch (current.tag) {
11686 case ClassComponent:
11687 {
11688 safelyDetachRef(current);
11689 var _instance6 = current.stateNode;
11690 if (typeof _instance6.componentWillUnmount === 'function') {
11691 safelyCallComponentWillUnmount(current, _instance6);
11692 }
11693 return;
11694 }
11695 case HostComponent:
11696 {
11697 safelyDetachRef(current);
11698 return;
11699 }
11700 case CallComponent:
11701 {
11702 commitNestedUnmounts(current.stateNode);
11703 return;
11704 }
11705 case HostPortal:
11706 {
11707 // TODO: this is recursive.
11708 // We are also not using this parent because
11709 // the portal will get pushed immediately.
11710 if (enableMutatingReconciler && mutation) {
11711 unmountHostComponents(current);
11712 } else if (enablePersistentReconciler && persistence) {
11713 emptyPortalContainer(current);
11714 }
11715 return;
11716 }
11717 }
11718 }
11719
11720 function commitNestedUnmounts(root) {
11721 // 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