"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactDom = _interopRequireDefault(require("react-dom"));
var ReactPortal = _ref => {
  var {
    children,
    node
  } = _ref;
  var [defaultNode, _] = _react.default.useState(node ? node : document.createElement('div'));
  if (!(typeof window !== 'undefined' && window.document && !!window.document.createElement)) {
    return null;
  }
  if (!node) {
    document.body.appendChild(defaultNode);
  }
  return /*#__PURE__*/_reactDom.default.createPortal(children, node || defaultNode);
};
var _default = exports.default = ReactPortal;
//# sourceMappingURL=ReactPortal.js.map