Skip to content

Commit

Permalink
Fix TS types + add better documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadorequest committed May 15, 2020
1 parent 58cd8a6 commit b52802b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/types/pageProps/SSGPageProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ import { MultiversalPageProps } from './MultiversalPageProps';
* 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
*/
export type SSGPageProps<E extends {} = {}> = {
// Props that are specific to SSG
isStaticRendering: boolean;
} & MultiversalPageProps & MultiversalAppBootstrapPageProps &E;
} & MultiversalPageProps // Generic props that are provided immediately, no matter what
& Partial<MultiversalAppBootstrapPageProps> // Pages served by SSG eventually benefit from props injected by the MultiversalAppBootstrap component
& E;
5 changes: 4 additions & 1 deletion src/types/pageProps/SSRPageProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ import { OnlyServerPageProps } from './OnlyServerPageProps';
* Client-side page props are listed in SSGPageProps
*/
export type SSRPageProps<E extends OnlyServerPageProps = OnlyServerPageProps> = {
// Props that are specific to SSR
isServerRendering: boolean;
} & MultiversalPageProps & MultiversalAppBootstrapPageProps & E;
} & MultiversalPageProps // Generic props that are provided immediately, no matter what
& Partial<MultiversalAppBootstrapPageProps> // Pages served by SSR eventually benefit from props injected by the MultiversalAppBootstrap component
& E;

0 comments on commit b52802b

Please sign in to comment.