"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard");exports.__esModule=true;exports.Portal=void 0;var React=_interopRequireWildcard(require("react"));var _reactDom=require("react-dom");const Portal=({children,type})=>{let portalNode=React.useRef(null);let[,forceUpdate]=React.useState();React.useEffect(()=>{portalNode.current=document.createElement(type);document.body.appendChild(portalNode.current);forceUpdate({});return()=>{if(portalNode.current){document.body.removeChild(portalNode.current);}};},[type]);return portalNode.current?/*#__PURE__*/(0,_reactDom.createPortal)(children,portalNode.current):null;};exports.Portal=Portal;
//# sourceMappingURL=index.js.map