2023-11-28 13:15:19 -05:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
|
|
// Preserved js license comment for web client app.
|
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
2023-08-11 10:53:27 -04:00
|
|
|
import React from "react"
|
|
|
|
import { createRoot } from "react-dom/client"
|
2023-12-05 18:03:05 -05:00
|
|
|
import { swrConfig } from "src/api"
|
2023-08-11 11:44:57 -04:00
|
|
|
import App from "src/components/app"
|
2023-12-05 10:09:33 -05:00
|
|
|
import ToastProvider from "src/ui/toaster"
|
2023-12-05 18:03:05 -05:00
|
|
|
import { SWRConfig } from "swr"
|
2023-08-11 10:53:27 -04:00
|
|
|
|
2023-08-22 16:14:00 -07:00
|
|
|
declare var window: any
|
|
|
|
// This is used to determine if the react client is built.
|
|
|
|
window.Tailscale = true
|
|
|
|
|
2023-08-11 10:53:27 -04:00
|
|
|
const rootEl = document.createElement("div")
|
|
|
|
rootEl.id = "app-root"
|
|
|
|
rootEl.classList.add("relative", "z-0")
|
|
|
|
document.body.append(rootEl)
|
|
|
|
|
|
|
|
const root = createRoot(rootEl)
|
|
|
|
|
|
|
|
root.render(
|
|
|
|
<React.StrictMode>
|
2023-12-05 18:03:05 -05:00
|
|
|
<SWRConfig value={swrConfig}>
|
|
|
|
<ToastProvider>
|
|
|
|
<App />
|
|
|
|
</ToastProvider>
|
|
|
|
</SWRConfig>
|
2023-08-11 10:53:27 -04:00
|
|
|
</React.StrictMode>
|
|
|
|
)
|