Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

client.tsx

23 lines660 Bytes

1import { StrictMode, startTransition } from 'react'
2import { hydrateRoot } from 'react-dom/client'
3import { StartClient } from '@tanstack/react-start/client'
4​
5async function bootstrap() {
6 // Fixture-only gate: leave SSR markup, CSS and inline restoration intact.
7 // Waiting here allows load to finish before StartClient constructs the router.
8 if ((window as any).__holdScrollBootstrap) {
9 await new Promise<void>((resolve) => {
10 ;(window as any).__releaseScrollBootstrap = resolve
11 })
12 }
13 startTransition(() => {
14 hydrateRoot(
15 document,
16 <StrictMode>
17 <StartClient />
18 </StrictMode>,
19 )
20 })
22​
23void bootstrap()