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

Function commitUnmount

code/higher-order-components/public/app.js:11423–11461  ·  view source on GitHub ↗
(current)

Source from the content-addressed store, hash-verified

11421 // deletion, so don't let them throw. Host-originating errors should
11422 // interrupt deletion, so it's okay
11423 function commitUnmount(current) {
11424 if (typeof onCommitUnmount === 'function') {
11425 onCommitUnmount(current);
11426 }
11427
11428 switch (current.tag) {
11429 case ClassComponent:
11430 {
11431 safelyDetachRef(current);
11432 var _instance6 = current.stateNode;
11433 if (typeof _instance6.componentWillUnmount === 'function') {
11434 safelyCallComponentWillUnmount(current, _instance6);
11435 }
11436 return;
11437 }
11438 case HostComponent:
11439 {
11440 safelyDetachRef(current);
11441 return;
11442 }
11443 case CallComponent:
11444 {
11445 commitNestedUnmounts(current.stateNode);
11446 return;
11447 }
11448 case HostPortal:
11449 {
11450 // TODO: this is recursive.
11451 // We are also not using this parent because
11452 // the portal will get pushed immediately.
11453 if (enableMutatingReconciler && mutation) {
11454 unmountHostComponents(current);
11455 } else if (enablePersistentReconciler && persistence) {
11456 emptyPortalContainer(current);
11457 }
11458 return;
11459 }
11460 }
11461 }
11462
11463 function commitNestedUnmounts(root) {
11464 // 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