import { getMountContainer } from './getMountContainer';
import { render, unmount as reactUnmount } from './render';
export var renderTo = function renderTo(element, mountContainer) {
  var container = document.createElement('div');
  getMountContainer(mountContainer).appendChild(container);

  var unmount = function unmount() {
    var unmountResult = reactUnmount(container);

    if (unmountResult && container.parentNode) {
      container.parentNode.removeChild(container);
    }
  };

  render(element, container);
  return unmount;
};