Skip to content

Commit b52802b

Browse files
committed
Fix TS types + add better documentation
1 parent 58cd8a6 commit b52802b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/types/pageProps/SSGPageProps.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ import { MultiversalPageProps } from './MultiversalPageProps';
1212
* XXX SSGPageProps doesn't extend from OnlyBrowserPageProps (like SSRPageProps does with OnlyServerPageProps) because SSG properties are actually generated by the server and don't have access to browser variables
1313
*/
1414
export type SSGPageProps<E extends {} = {}> = {
15+
// Props that are specific to SSG
1516
isStaticRendering: boolean;
16-
} & MultiversalPageProps & MultiversalAppBootstrapPageProps &E;
17+
} & MultiversalPageProps // Generic props that are provided immediately, no matter what
18+
& Partial<MultiversalAppBootstrapPageProps> // Pages served by SSG eventually benefit from props injected by the MultiversalAppBootstrap component
19+
& E;

src/types/pageProps/SSRPageProps.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ import { OnlyServerPageProps } from './OnlyServerPageProps';
1111
* Client-side page props are listed in SSGPageProps
1212
*/
1313
export type SSRPageProps<E extends OnlyServerPageProps = OnlyServerPageProps> = {
14+
// Props that are specific to SSR
1415
isServerRendering: boolean;
15-
} & MultiversalPageProps & MultiversalAppBootstrapPageProps & E;
16+
} & MultiversalPageProps // Generic props that are provided immediately, no matter what
17+
& Partial<MultiversalAppBootstrapPageProps> // Pages served by SSR eventually benefit from props injected by the MultiversalAppBootstrap component
18+
& E;

0 commit comments

Comments
 (0)