code: function unmountComponent(component) {
      if (options.beforeUnmount) options.beforeUnmount(component);
  
      var base = component.base;
  
      component._disable = true;
  
      if (component.componentWillUnmount) component.componentWillUnmount();
  
      component.base = null;
  
      // recursively tear down & recollect high-order component children:
      var inner = component._component;
      if (inner) {
        unmountComponent(inner);
      } else if (base) {
        if (base['__preactattr_'] && base['__preactattr_'].ref) base['__preactattr_'].ref(null);
  
        component.nextBase = base;
  
        removeNode(base);
        collectComponent(component);
  
        removeChildren(base);
      }
  
      if (component.__ref) component.__ref(null);
    }
docs: Remove a component from the DOM and recycle it.
  @param {Component} component	The Component instance to unmount
  @private