Skip to content

Commit 2a9b086

Browse files
authored
Add children to AppRouterPageRouteOpts to support Layout usage
This will add `children` as an accepted parameter to `withPageAuthRequired`, which is necessary for usage in Layout files.
1 parent 951a248 commit 2a9b086

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/helpers/with-page-auth-required.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ export type PageRoute<P, Q extends ParsedUrlQuery = ParsedUrlQuery> = (
3636
) => Promise<GetServerSidePropsResultWithSession<P>>;
3737

3838
/**
39-
* Objects containing the route parameters and search parameters of th page.
39+
* Objects containing the route parameters and search parameters of the page or layout.
4040
*
4141
* @category Server
4242
*/
4343
export type AppRouterPageRouteOpts = {
44+
children?: React.ReactNode;
4445
params?: Record<string, string | string[]>;
4546
searchParams?: { [key: string]: string | string[] | undefined };
4647
};

0 commit comments

Comments
 (0)