@wordpress/element
Version:
Element React module for WordPress.
22 lines (21 loc) • 473 B
JavaScript
// packages/element/src/raw-html.ts
import { Children, createElement } from "./react";
function RawHTML({
children,
...props
}) {
let rawHtml = "";
Children.toArray(children).forEach((child) => {
if (typeof child === "string" && child.trim() !== "") {
rawHtml += child;
}
});
return createElement("div", {
dangerouslySetInnerHTML: { __html: rawHtml },
...props
});
}
export {
RawHTML as default
};
//# sourceMappingURL=raw-html.js.map