mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 03:32:36 +08:00
38 lines
974 B
TypeScript
38 lines
974 B
TypeScript
/// <reference types="vite/client" />
|
|
/// <reference types="vite-plugin-svgr/client" />
|
|
import "./assets/styles/index.scss";
|
|
|
|
import { ResizeObserver } from "@juggle/resize-observer";
|
|
if (!window.ResizeObserver) {
|
|
window.ResizeObserver = ResizeObserver;
|
|
}
|
|
|
|
import React from "react";
|
|
import { createRoot } from "react-dom/client";
|
|
import { RecoilRoot } from "recoil";
|
|
import { BrowserRouter } from "react-router-dom";
|
|
import { BaseErrorBoundary } from "./components/base";
|
|
import Layout from "./pages/_layout";
|
|
import "./services/i18n";
|
|
|
|
const mainElementId = "root";
|
|
const container = document.getElementById(mainElementId);
|
|
|
|
if (!container) {
|
|
throw new Error(
|
|
`No container '${mainElementId}' found to render application`
|
|
);
|
|
}
|
|
|
|
createRoot(container).render(
|
|
<React.StrictMode>
|
|
<RecoilRoot>
|
|
<BaseErrorBoundary>
|
|
<BrowserRouter>
|
|
<Layout />
|
|
</BrowserRouter>
|
|
</BaseErrorBoundary>
|
|
</RecoilRoot>
|
|
</React.StrictMode>
|
|
);
|