Skip to content

Commit a60c718

Browse files
committed
docs: update ssr imports to @tanstack/react-router-server
1 parent a4e23a8 commit a60c718

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/guide/ssr.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Non-Streaming server-side rendering is the classic process of rendering the mark
2121

2222
To implement non-streaming SSR with TanStack Router, you will need the following utilities:
2323

24-
- `StartServer` from `@tanstack/react-start/server`
24+
- `StartServer` from `@tanstack/react-router-server`
2525
- e.g. `<StartServer router={router} />`
2626
- Rendering this component in your server entry will render your application and also automatically handle application-level hydration/dehydration and implement the `Wrap` component option on `Router`
27-
- `StartClient` from `@tanstack/react-start/client`
27+
- `StartClient` from `@tanstack/react-router-client`
2828
- e.g. `<StartClient router={router} />`
2929
- Rendering this component in your client entry will render your application and also automatically implement the `Wrap` component option on `Router`
30-
- `DehydrateRouter` from `@tanstack/react-start/client`
30+
- `DehydrateRouter` from `@tanstack/react-router-client`
3131
- e.g. `<DehydrateRouter />`
3232
- Render this component **inside your application** to embed the router's dehydrated data into the application.
3333

@@ -134,7 +134,7 @@ To do this, render the `<DehydrateRouter />` component somewhere inside your Roo
134134
// src/root.tsx
135135

136136
import * as React from 'react'
137-
import { DehydrateRouter } from '@tanstack/react-start/client'
137+
import { DehydrateRouter } from '@tanstack/react-router-client'
138138

139139
export function Root() {
140140
return (
@@ -166,7 +166,7 @@ Here is a complete example of a server entry file that uses all of the concepts
166166
import * as React from 'react'
167167
import ReactDOMServer from 'react-dom/server'
168168
import { createMemoryHistory } from '@tanstack/react-router'
169-
import { StartServer } from '@tanstack/react-start/server'
169+
import { StartServer } from '@tanstack/react-router-server'
170170
import { createRouter } from './router'
171171

172172
export async function render(url, response) {
@@ -204,7 +204,7 @@ On the client, things are much simpler.
204204
import * as React from 'react'
205205
import ReactDOM from 'react-dom/client'
206206

207-
import { StartClient } from '@tanstack/react-start/client'
207+
import { StartClient } from '@tanstack/react-router-client'
208208
import { createRouter } from './router'
209209

210210
const router = createRouter()
@@ -223,14 +223,14 @@ This pattern can be useful for pages that have slow or high-latency data fetchin
223223

224224
To enable this streaming pattern with TanStack Router, you will need to use React's `renderToPipeableStream` function to render your application to a readable stream. This function returns a stream that can be piped to the response. Here's the utility information:
225225

226-
- `transformStreamWithRouter` from `@tanstack/react-start/server`
226+
- `transformStreamWithRouter` from `@tanstack/react-router-server`
227227
- e.g. `transformStreamWithRouter(router)`
228228
- This function returns a stream Transform instance that can be used to transform a stream of HTML markup from React DOM's `renderToPipeableStream` function as it is piped to the response.
229229
- This transform automatically and incrementally embeds fine-grained HTML injections and dehydrated data chunks into the stream.
230230

231231
### Transforming the Stream
232232

233-
Let's implement the `transformStreamWithRouter` function from `@tanstack/react-start/server` to transform the stream of HTML markup from React DOM's `renderToPipeableStream` function as it is piped to the response.
233+
Let's implement the `transformStreamWithRouter` function from `@tanstack/react-router-server` to transform the stream of HTML markup from React DOM's `renderToPipeableStream` function as it is piped to the response.
234234

235235
```tsx
236236
// Render the app to a readable stream

0 commit comments

Comments
 (0)