Files
ohif-viewer/src/index_publish.js
T

21 lines
546 B
JavaScript

/**
* Entry point index.js for rollup packaging
*/
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.js';
function installViewer(props, containerId = "root", callback) {
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 {...props}/>, container, callback);
}
export { App, installViewer };