function isValid(node, id) {
  if (node) {
    !(internalGetID(node) === id) ? "development" !== 'production' ? invariant(false, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME) : invariant(false) : undefined;

    var container = ReactMount.findReactContainerForID(id);
    if (container && containsNode(container, node)) {
      return true;
    }
  }

  return false;
}
A node is "valid" if it is contained by a currently mounted container.

This means that the node does not have to be contained by a document in
order to be considered valid.

@param {?DOMElement} node The candidate DOM node.
@param {string} id The expected ID of the node.
@return {boolean} Whether the node is contained by a mounted container.