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

Function commitUnmount

code/styling/public/app.js:11429–11467  ·  view source on GitHub ↗
(current)

Source from the content-addressed store, hash-verified

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