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

StartClient.tsx

19 lines474 Bytes

1import { Await, RouterProvider } from '@tanstack/react-router'
2​
3import { hydrateStart } from '@tanstack/start-client-core/client'
4​
5import type { AnyRouter } from '@tanstack/router-core'
6​
7let hydrationPromise: Promise<AnyRouter> | undefined
8export function StartClient() {
9 if (!hydrationPromise) {
10 hydrationPromise = hydrateStart()
11 }
12​
13 return (
14 <Await
15 promise={hydrationPromise}
16 children={(router) => <RouterProvider router={router} />}
17 />
18 )