UNPKG

@anoki/fse-ui

Version:

FSE UI components library

18 lines (17 loc) 628 B
import * as r from "react"; import f from "react-dom"; import { Primitive as u } from "./index.es474.js"; import { useLayoutEffect as c } from "./index.es493.js"; import { j as l } from "./index.es244.js"; var p = "Portal", d = r.forwardRef((e, a) => { var o; const { container: s, ...i } = e, [m, n] = r.useState(!1); c(() => n(!0), []); const t = s || m && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body); return t ? f.createPortal(/* @__PURE__ */ l.jsx(u.div, { ...i, ref: a }), t) : null; }); d.displayName = p; export { d as Portal }; //# sourceMappingURL=index.es488.js.map