code: function findRootContainerNode(inst) {
    // TODO: It may be a good idea to cache this to prevent unnecessary DOM
    // traversal, but caching is difficult to do correctly without using a
    // mutation observer to listen for all DOM changes.
    if (typeof inst.tag === 'number') {
      while (inst['return']) {
        inst = inst['return'];
      }
      if (inst.tag !== HostRoot) {
        // This can happen if we're in a detached tree.
        return null;
      }
      return inst.stateNode.containerInfo;
    } else {
      while (inst._hostParent) {
        inst = inst._hostParent;
      }
      var rootNode = ReactDOMComponentTree_1.getNodeFromInstance(inst);
      return rootNode.parentNode;
    }
  }
docs: Find the deepest React component completely containing the root of the
  passed-in instance (for use when entire React trees are nested within each
  other). If React trees are not nested, returns null.