Files
ohif-viewer/platform/viewer/src/index-umd.js
T

22 lines
605 B
JavaScript
Raw Normal View History

2019-08-13 15:36:46 -04:00
/**
* Entry point index.js for UMD packaging
*/
import 'regenerator-runtime/runtime';
2019-08-13 15:36:46 -04:00
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.js';
function installViewer(config, containerId = 'root', callback) {
2019-08-13 15:36:46 -04:00
const container = document.getElementById(containerId);
if (!container) {
throw new Error(
"No root element found to install viewer. Please add a <div> with the id 'root', or pass a DOM element into the installViewer function."
);
}
return ReactDOM.render(<App config={config} />, container, callback);
2019-08-13 15:36:46 -04:00
}
export { App, installViewer };