function handleTopLevelImpl(bookKeeping) {
  var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
  var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);

  // Loop through the hierarchy, in case there's any nested components.
  // It's important that we build the array of ancestors before calling any
  // event handlers, because event handlers can modify the DOM, leading to
  // inconsistencies with ReactMount's node cache. See #1105.
  var ancestor = targetInst;
  do {
    bookKeeping.ancestors.push(ancestor);
    ancestor = ancestor && findParent(ancestor);
  } while (ancestor);

  for (var i = 0; i < bookKeeping.ancestors.length; i++) {
    targetInst = bookKeeping.ancestors[i];
    ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
  }
}
Renders a React component into the DOM in the supplied `container`.

If the React component was previously rendered into `container`, this will
perform an update on it and only mutate the DOM as necessary to reflect the
latest React component.

@param {ReactComponent} parentComponent The conceptual parent of this render tree.
@param {ReactElement} nextElement Component element to render.
@param {DOMElement} container DOM element to render into.
@param {?function} callback function triggered on completion
@return {ReactComponent} Component instance rendered in `container`.