2024-06-05 23:22:47 +00:00
|
|
|
import React from 'react'
|
2024-09-12 07:43:28 +00:00
|
|
|
import ReactDOM from 'react-dom/client'
|
|
|
|
|
import App from './App.js'
|
2024-06-01 02:40:44 +00:00
|
|
|
|
2024-09-12 07:43:28 +00:00
|
|
|
const app = document.getElementById('app')
|
|
|
|
|
if (!app) throw new Error('missing app element')
|
2024-06-01 02:40:44 +00:00
|
|
|
|
2024-09-16 02:29:31 +00:00
|
|
|
const params = new URLSearchParams(location.search)
|
|
|
|
|
const url = params.get('key') || undefined
|
|
|
|
|
|
2024-09-12 07:43:28 +00:00
|
|
|
// @ts-expect-error TODO: fix react createRoot type
|
|
|
|
|
const root = ReactDOM.createRoot(document.getElementById('app'))
|
2024-09-16 02:29:31 +00:00
|
|
|
root.render(React.createElement(App, { url }))
|