'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var React = require('react');
var reactDom = require('react-dom');
var jsxRuntime = require('react/jsx-runtime');

function withNextPortalWrapper(Component) {
  return function (props) {
    const [mounted, setMounted] = React.useState(false);
    React.useEffect(() => {
      setMounted(true);
    }, [setMounted]);
    return mounted ? /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/jsxRuntime.jsx(Component, {
      ...props
    }), document.body) : null;
  };
}

exports.default = withNextPortalWrapper;
//# sourceMappingURL=withNextPortal.js.map
