Skip to content

Commit 9940686

Browse files
authored
add support for props.notFound to getStaticContent() (#604)
1 parent 7c0ccde commit 9940686

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

packages/root/src/cli/build.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ export async function build(rootProjectDir?: string, options?: BuildOptions) {
417417
rootConfig,
418418
params: sitemapItem.params,
419419
});
420+
if (props?.notFound) {
421+
return;
422+
}
420423
} else {
421424
props = {rootConfig, params: sitemapItem.params};
422425
}

packages/root/src/render/render.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ export class Renderer {
221221
rootConfig: this.rootConfig,
222222
params: routeParams,
223223
});
224+
if (props?.notFound) {
225+
return render404();
226+
}
224227
} else {
225228
props = {rootConfig: this.rootConfig, params: routeParams};
226229
}

0 commit comments

Comments
 (0)