@dndbuilder.com/react
Version:
Drag and drop builder for React
27 lines (26 loc) • 837 B
JavaScript
"use client";
import { jsx as m } from "react/jsx-runtime";
import { classNames as c } from "../../../../../utils.js";
import { useState as u, useEffect as a } from "react";
import i from "./frame.js";
const E = ({ children: n, className: o, ...l }) => {
const [t, r] = u();
return a(() => {
const e = document.implementation.createHTMLDocument();
e.documentElement.setAttribute("class", "h-full"), e.body.setAttribute("class", "h-full"), document.querySelectorAll('link[rel="stylesheet"]').forEach((s) => {
e.head.appendChild(s.cloneNode(!0));
}), r(e.documentElement.outerHTML);
}, []), t ? /* @__PURE__ */ m(
i,
{
initialContent: t,
className: c("h-full w-full", o),
...l,
children: n
}
) : null;
};
export {
E as RenderFrame
};
//# sourceMappingURL=render-frame.js.map