-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.tsx
27 lines (24 loc) · 876 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { InscriptionClientJsonRpc } from '@axonivy/inscription-core';
import { AppStateView } from '@axonivy/inscription-editor';
import { createRoot } from 'react-dom/client';
import './index.css';
import { LazyApp, type LazyAppProps } from './lazy-app';
import { URLParams } from './url-helper';
export async function start(): Promise<void> {
const props: LazyAppProps = {
server: URLParams.webSocketBase(),
app: URLParams.app(),
pmv: URLParams.pmv(),
pid: URLParams.pid(),
theme: URLParams.themeMode(),
clientCreator: () => InscriptionClientJsonRpc.startWebSocketClient(props.server!)
};
const root = createRoot(document.getElementById('root')!);
try {
root.render(<LazyApp {...props} />);
} catch (error) {
console.error(error);
root.render(<AppStateView>{'An error has occurred: ' + error}</AppStateView>);
}
}
start();