"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.renderToContainer = renderToContainer;

function _react() {
  const data = _interopRequireDefault(require("react"));

  _react = function () {
    return data;
  };

  return data;
}

function _reactDom() {
  const data = require("react-dom");

  _reactDom = function () {
    return data;
  };

  return data;
}

var _getContainer = require("./getContainer");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function renderToContainer(getContainer, node) {
  if (getContainer) {
    const container = (0, _getContainer.resolveContainer)(getContainer);
    return (0, _reactDom().createPortal)(node, container);
  }

  return node;
}