import { legacyReactRenderer } from "./render.js";
import { createErrorHandler } from "@contember/react-devbar";
const runReactApp = (reactElement, domRoot, render = legacyReactRenderer) => {
  const rootEl = domRoot instanceof HTMLElement ? domRoot : typeof domRoot === "string" ? document.querySelector(domRoot) : document.body.appendChild(document.createElement("div"));
  if (!rootEl) {
    throw new Error(`Undefined react root element`);
  }
  const errorHandler = createErrorHandler(render);
  errorHandler((onRecoverableError) => render(rootEl, reactElement, onRecoverableError));
};
export {
  runReactApp
};
//# sourceMappingURL=runReactApp.js.map
