-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.tsx
43 lines (36 loc) · 1.28 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* eslint-disable no-restricted-imports */
/* eslint-disable import/order */
import ReactDOM from 'react-dom/client';
import '@gravity-ui/uikit/styles/styles.scss';
import {ErrorBoundary} from './lib';
import reportWebVitals from './reportWebVitals';
import {history, store} from './store/defaultStore';
import './styles/themes.scss';
import './styles/unipika.scss';
import './index.css';
async function render() {
let App;
if (
process.env.REACT_APP_META_BACKEND === undefined ||
process.env.REACT_APP_META_BACKEND === 'undefined'
) {
App = await import('./lib').then(({SingleClusterApp}) => SingleClusterApp);
} else {
App = await import('./lib').then(({MultiClusterApp}) => MultiClusterApp);
}
const container = document.getElementById('root');
if (!container) {
throw new Error("Can't find root element");
}
const root = ReactDOM.createRoot(container);
root.render(
<ErrorBoundary>
<App store={store} history={history} />
</ErrorBoundary>,
);
}
render();
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();