Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions packages/plugin-rsc/examples/no-ssr/src/framework/entry.rsc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ export default async function handler(request: Request): Promise<Response> {
}
}

const rscStream = ReactServer.renderToReadableStream<RscPayload>({
root: <Root />,
returnValue,
formState,
})
const rscPayload: RscPayload = { root: <Root />, formState, returnValue }
const rscOptions = { temporaryReferences }
const rscStream = ReactServer.renderToReadableStream<RscPayload>(
rscPayload,
rscOptions,
)

return new Response(rscStream, {
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ async function handler(request: Request): Promise<Response> {
// we render RSC stream after handling server function request
// so that new render reflects updated state from server function call
// to achieve single round trip to mutate and fetch from server.
const rscStream = ReactServer.renderToReadableStream<RscPayload>({
// in this example, we always render the same `<Root />`
root: <Root />,
returnValue,
formState,
})
const rscPayload: RscPayload = { root: <Root />, formState, returnValue }
const rscOptions = { temporaryReferences }
const rscStream = ReactServer.renderToReadableStream<RscPayload>(
rscPayload,
rscOptions,
)

// respond RSC stream without HTML rendering based on framework's convention.
// here we use request header `content-type`.
Expand Down
12 changes: 6 additions & 6 deletions packages/plugin-rsc/examples/starter/src/framework/entry.rsc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ export default async function handler(request: Request): Promise<Response> {
// we render RSC stream after handling server function request
// so that new render reflects updated state from server function call
// to achieve single round trip to mutate and fetch from server.
const rscStream = ReactServer.renderToReadableStream<RscPayload>({
// in this example, we always render the same `<Root />`
root: <Root />,
returnValue,
formState,
})
const rscPayload: RscPayload = { root: <Root />, formState, returnValue }
const rscOptions = { temporaryReferences }
const rscStream = ReactServer.renderToReadableStream<RscPayload>(
rscPayload,
rscOptions,
)

// respond RSC stream without HTML rendering based on framework's convention.
// here we use request header `content-type`.
Expand Down
Loading