-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
43 lines (38 loc) · 1.14 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
// SPDX-FileCopyrightText: 2023 Kaelan Thijs Fouwels <[email protected]>
//
// SPDX-License-Identifier: MIT
import * as ReactDom from 'react-dom/client'
import * as ReactRouter from 'react-router-dom'
import { Main } from './lib/views/main'
import { RoutingError } from './lib/views/error'
import { Header } from './lib/components/header'
import { Experiments } from './lib/views/experiments'
function banner (): undefined {
console.log(
'** additional logs emitted at verbose/debug log levels **'
)
}
banner()
const router = ReactRouter.createHashRouter([
{
path: '',
element: <><Header /><Main /></>,
errorElement: <><Header /><RoutingError /></>
},
{
path: '/main',
element: <><Header /><Main /></>,
errorElement: <><Header /><RoutingError /></>
},
{
path: '/experiments',
element: <><Header /><Experiments /></>,
errorElement: <><Header /><RoutingError /></>
}
])
const root = document.getElementById('root')
if (root === null) {
throw new Error('could not get element id root?')
}
const reactRoot = ReactDom.createRoot(root)
reactRoot.render(<ReactRouter.RouterProvider router={router} />)