@talend/react-cmf
Version:
A framework built on top of best react libraries
29 lines • 813 B
JavaScript
/* eslint-disable no-underscore-dangle */
import bootstrap from '../bootstrap';
import registry from '../registry';
import { jsx as _jsx } from "react/jsx-runtime";
export async function prepareCMF(jsx, opts = {}) {
// reset global registry
const reg = registry.getRegistry();
reg._registry = {};
reg._isLocked = false;
function Wrapper() {
return jsx;
}
const config = await bootstrap({
RootComponent: Wrapper,
render: false,
modules: [(opts === null || opts === void 0 ? void 0 : opts.cmfModule) || {
id: 'empty'
}]
});
config.saga.run();
return /*#__PURE__*/_jsx(config.App, {
store: config.store,
loading: opts.AppLoader,
withSettings: !!opts.settingsURL,
registry: registry.getRegistry(),
children: jsx
});
}
//# sourceMappingURL=rtl.js.map