-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tsx
24 lines (22 loc) · 810 Bytes
/
main.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
import {createRoot} from 'react-dom/client';
import {RouterProvider} from "react-router-dom";
import '../src/styles/App.scss'
import '../src/styles/globals.css'
import router from "./components/layout/router";
import {StrictMode} from "react";
import Fallback from "./components/Fallback";
import {renderToString} from "react-dom/server";
import {SUPPORT_EMAIL} from "./constants.tsx";
//
// import {config} from "dotenv";
// config({path: '../.env'});
const rootElement = document.getElementById('root');
if (rootElement) {
const root = createRoot(rootElement);
root.render(<StrictMode>
<RouterProvider router={router}/>
</StrictMode>);
} else {
console.error("Container element not found!");
document.body.innerHTML = renderToString(<Fallback supportEmail={SUPPORT_EMAIL}/>);
}