import React from 'react';
import ReactDOM from 'react-dom/client';
import { App } from './Components/App/App';
import './index.scss';

function RenderRoot(root: Element | Document): void {
  ReactDOM.createRoot(root.querySelector('#root') as HTMLDivElement).render(
    <React.StrictMode>
      <App root={root}/>
    </React.StrictMode>
  );
}

// Specific for Modeler apps
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace SVGLayoutDesigner {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  export const Render = RenderRoot;
}

(window as any).SVGLayoutDesigner = SVGLayoutDesigner;

RenderRoot(document);
