code: function getNodeFromInstance(inst) {
    if (inst.tag === HostComponent || inst.tag === HostText) {
      // In Fiber this, is just the state node right now. We assume it will be
      // a host component or host text.
      return inst.stateNode;
    }
  
    // Without this first invariant, passing a non-DOM-component triggers the next
    // invariant for a missing parent, which is super confusing.
    !(inst._hostNode !== undefined) ? invariant(false, 'getNodeFromInstance: Invalid argument.') : void 0;
  
    if (inst._hostNode) {
      return inst._hostNode;
    }
  
    // Walk up the tree until we find an ancestor whose DOM node we have cached.
    var parents = [];
    while (!inst._hostNode) {
      parents.push(inst);
      !inst._hostParent ? invariant(false, 'React DOM tree root should always have a node reference.') : void 0;
      inst = inst._hostParent;
    }
  
    // Now parents contains each ancestor that does *not* have a cached native
    // node, and `inst` is the deepest ancestor that does.
    for (; parents.length; inst = parents.pop()) {
      precacheChildNodes(inst, inst._hostNode);
    }
  
    return inst._hostNode;
  }
docs: Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
  DOM node.