Skip to content

Commit bee95e7

Browse files
committed
add noStreaming option
1 parent 23d02d4 commit bee95e7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@ export class StaticRouters {
4545
if (error instanceof ClientOnlyError) return;
4646
console.error(error, errorInfo);
4747
},
48+
noStreaming,
4849
}: {
4950
Shell: React.ComponentType<{ children: React.ReactElement }>;
5051
preloadScript?: string;
5152
bootstrapModules?: string[];
5253
context?: T;
5354
onError?(error: unknown, errorInfo: React.ErrorInfo): string | void;
55+
noStreaming?: boolean;
5456
}
5557
): Promise<Response | null> {
5658
const { pathname, search } = new URL(request.url);
@@ -108,6 +110,9 @@ export class StaticRouters {
108110
onError,
109111
}
110112
);
113+
if (noStreaming) {
114+
await stream.allReady;
115+
}
111116
return new Response(stream, {
112117
headers: {
113118
"Content-Type": "text/html; charset=utf-8",

0 commit comments

Comments
 (0)