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

README.md

21 lines644 Bytes

1# @tanstack/react-router-with-db
2​
3TanStack Router and TanStack Start SSR integration for TanStack DB.
4​
5```tsx
6const dbClient = new DbClient()
7const router = createRouter({
8 routeTree,
9 context: { dbClient },
10})
11​
12export default routerWithDbClient(router, dbClient)
13```
14​
15The adapter provides the client, hydrates critical DB state, and streams
16`useLiveSuspenseQuery` calls discovered during server rendering. Streamed
17promises resolve to ordered live-query result snapshots. Source collections
18start normally in the browser and replace the snapshot when their live result is
19ready.
20​
21See the [SSR and Hydration guide](../../docs/guides/ssr.md).