use react 18 concurrent mode

This commit is contained in:
MapleLeaf
2021-12-31 16:36:03 -06:00
committed by Darius
parent e64d3cbdfd
commit 9afb8e47d2
3 changed files with 70 additions and 18 deletions

View File

@@ -10,8 +10,8 @@
"dependencies": {
"express": "^4.17.2",
"reacord": "workspace:*",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.0.0-rc.0",
"react-dom": "^18.0.0-rc.0",
"react-head": "^3.4.0",
"react-router-dom": "^6.2.1"
},

View File

@@ -1,13 +1,18 @@
import { hydrate } from "react-dom"
import { createRoot } from "react-dom"
import { HeadProvider } from "react-head"
import { ReactLocation } from "react-location"
import { App } from "./app"
const location = new ReactLocation()
hydrate(
createRoot(document.querySelector("#app")!).render(
<HeadProvider>
<App location={location} />
</HeadProvider>,
document.querySelector("#app"),
)
declare module "react-dom" {
export function createRoot(element: Element): {
render(element: React.ReactNode): void
}
}