Skip to content

Commit

Permalink
chore(performance): Optimize rehydration
Browse files Browse the repository at this point in the history
  • Loading branch information
damassi committed Dec 4, 2024
1 parent 2561d81 commit 98129ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { setupClientRouter } from "System/Router/clientRouter"
import { setupSentryClient } from "System/Utils/setupSentryClient"
import { setupWebVitals } from "System/Utils/setupWebVitals"
import { hydrateRoot } from "react-dom/client"
import { startTransition } from "react"

setupAnalytics()
setupSentryClient()
Expand All @@ -18,10 +19,12 @@ setupWebVitals()
})

loadableReady().then(() => {
hydrateRoot(
document.getElementById("react-root") as HTMLElement,
<ClientRouter />
)
startTransition(() => {
hydrateRoot(
document.getElementById("react-root") as HTMLElement,
<ClientRouter />
)
})
})
})()

Expand Down

0 comments on commit 98129ab

Please sign in to comment.