mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
chore: Upgrade to React 18 (#495)
* chore: Upgrade to React 18 * runfix: Add children type to FC components * chore: Remove @types/react
This commit is contained in:
16
src/main.tsx
16
src/main.tsx
@@ -8,19 +8,27 @@ if (!window.ResizeObserver) {
|
||||
}
|
||||
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { RecoilRoot } from "recoil";
|
||||
import { BrowserRouter } from "react-router-dom";
|
||||
import Layout from "./pages/_layout";
|
||||
import "./services/i18n";
|
||||
|
||||
ReactDOM.render(
|
||||
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>
|
||||
<BrowserRouter>
|
||||
<Layout />
|
||||
</BrowserRouter>
|
||||
</RecoilRoot>
|
||||
</React.StrictMode>,
|
||||
document.getElementById("root")
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user