Skip to content

Commit 797dd4f

Browse files
committed
add context
1 parent 6561437 commit 797dd4f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ export class StaticRouters {
2929
"/" + relative(join(baseDir, buildDir), filePath),
3030
])
3131
),
32-
{
33-
omitStack: true,
34-
}
32+
{ omitStack: true }
3533
);
3634
}
3735

38-
async serve(
36+
async serve<T = void>(
3937
request: Request,
4038
{
4139
Shell,
4240
preloadScript,
4341
bootstrapModules,
42+
context,
4443
}: {
4544
Shell: React.ComponentType<{ children: React.ReactElement }>;
4645
preloadScript?: string;
4746
bootstrapModules?: string[];
47+
context?: T;
4848
}
4949
) {
5050
const { pathname, search } = new URL(request.url);
@@ -66,6 +66,7 @@ export class StaticRouters {
6666
params: serverSide.params,
6767
req: request,
6868
query: serverSide.query,
69+
context,
6970
});
7071
const stringified = NJSON.stringify(result, { omitStack: true });
7172
if (request.headers.get("Accept") === "application/vnd.server-side-props") {

0 commit comments

Comments
 (0)