code: function commitUnmount(current$$1) {
    onCommitUnmount(current$$1);
  
    switch (current$$1.tag) {
      case FunctionComponent:
      case ForwardRef:
      case MemoComponent:
      case SimpleMemoComponent:
        {
          var updateQueue = current$$1.updateQueue;
          if (updateQueue !== null) {
            var lastEffect = updateQueue.lastEffect;
            if (lastEffect !== null) {
              var firstEffect = lastEffect.next;
              var effect = firstEffect;
              do {
                var destroy = effect.destroy;
                if (destroy !== undefined) {
                  safelyCallDestroy(current$$1, destroy);
                }
                effect = effect.next;
              } while (effect !== firstEffect);
            }
          }
          break;
        }
      case ClassComponent:
        {
          safelyDetachRef(current$$1);
          var instance = current$$1.stateNode;
          if (typeof instance.componentWillUnmount === 'function') {
            safelyCallComponentWillUnmount(current$$1, instance);
          }
          return;
        }
      case HostComponent:
        {
          safelyDetachRef(current$$1);
          return;
        }
      case HostPortal:
        {
          // TODO: this is recursive.
          // We are also not using this parent because
          // the portal will get pushed immediately.
          if (supportsMutation) {
            unmountHostComponents(current$$1);
          } else if (supportsPersistence) {
            emptyPortalContainer(current$$1);
          }
          return;
        }
    }
  }
docs: User-originating errors (lifecycles and refs) should not interrupt deletion, so don't let them throw. Host-originating errors should interrupt deletion, so it's okay