Skip to content

Commit

Permalink
[example] Add next.js SSG clarification comment (#20810)
Browse files Browse the repository at this point in the history
  • Loading branch information
sospedra authored Apr 28, 2020
1 parent 24cdb5b commit ceb7cda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/nextjs-with-typescript/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export default class MyDocument extends Document {
}
}

// `getInitialProps` belongs to `_document` (instead of `_app`),
// it's compatible with server-side generation (SSG).
MyDocument.getInitialProps = async (ctx) => {
// Resolution order
//
Expand Down
2 changes: 2 additions & 0 deletions examples/nextjs/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export default class MyDocument extends Document {
}
}

// `getInitialProps` belongs to `_document` (instead of `_app`),
// it's compatible with server-side generation (SSG).
MyDocument.getInitialProps = async (ctx) => {
// Resolution order
//
Expand Down

1 comment on commit ceb7cda

@sybercoda
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused. getinitialProps is for SSR (server side rendering). I can't make sense of the comment it's compatible with server-side generation (SSG) because NextJS defines SSR as Server Side Rendering and SSG as Static Site Generation.

Please sign in to comment.