Skip to content

Commit

Permalink
Merge pull request #14940 from artsy/damassi/optimize-hydration
Browse files Browse the repository at this point in the history
chore(performance): Optimize rehydration
  • Loading branch information
damassi authored Dec 4, 2024
2 parents 2561d81 + 98129ab commit 9e2e57c
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 9e2e57c

Please sign in to comment.