"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

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

var ReactDOM = _interopRequireWildcard(require("react-dom"));

var _ = require(".");

var _getMountContainer = require("./getMountContainer");

function renderToContainer(mountContainer, node) {
  if (_.canUseDOM && mountContainer) {
    var container = (0, _getMountContainer.getMountContainer)(mountContainer);
    return /*#__PURE__*/ReactDOM.createPortal(node, container);
  }

  return node;
}