Skip to content

Commit 9f8aa74

Browse files
committed
refactor: enhance error handling and component structure in request.server.ts
- Updated defaultErrorRenderer to mask API_URL in error messages. - Changed Component type to FC for better type safety. - Improved parameter handling in definePrerenderPage for clarity. - Adjusted error handling to correctly manage NEXT_HTTP_ERROR_FALLBACK;404. Signed-off-by: Innei <[email protected]>
1 parent 89ae354 commit 9f8aa74

File tree

4 files changed

+278
-234
lines changed

4 files changed

+278
-234
lines changed

global.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ declare global {
1111
} & Props
1212
>
1313

14+
export type NextPageExtractedParams<
15+
P extends {},
16+
Props = {},
17+
> = PropsWithChildren<
18+
{
19+
params: P
20+
} & Props
21+
>
1422
export type Component<P = {}> = FC<ComponentType & P>
1523

1624
export type ComponentType<P = {}> = {

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/dev/types/routes.d.ts";
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

0 commit comments

Comments
 (0)