detach method

void detach()

Implementation

void detach() {
  if (!attached) return;

  // Unregister from the runtime so its DOM node and tree snapshot
  // are released. This prevents stale diffs on components that have
  // been removed from the tree.
  _runtime?.unregisterComponent(this);

  attached = false;
  _runtime = null;
}