@konstructio/ui
Version:
A set of reusable and customizable React components built for konstruct.io
15 lines (14 loc) • 462 B
JavaScript
import * as o from "react";
import m from "react-dom";
import { u as c, P as f } from "./index-DKfEnhKr.js";
import { jsx as l } from "react/jsx-runtime";
var u = "Portal", p = o.forwardRef((r, a) => {
const { container: e, ...s } = r, [n, i] = o.useState(!1);
c(() => i(!0), []);
const t = e || n && globalThis?.document?.body;
return t ? m.createPortal(/* @__PURE__ */ l(f.div, { ...s, ref: a }), t) : null;
});
p.displayName = u;
export {
p as P
};