Skip to content

Commit

Permalink
fix type definition for defaultGetInitialProps (#36252)
Browse files Browse the repository at this point in the history
## Bug

- [X] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

This PR fixes #36247 by adding the optional `options` object to the type definition for `DocumentContext.defaultGetInitialProps`.
  • Loading branch information
seanparmelee committed Apr 19, 2022
1 parent deb8280 commit ffdb9f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/next/shared/lib/utils.ts
Expand Up @@ -178,7 +178,10 @@ export type AppPropsType<

export type DocumentContext = NextPageContext & {
renderPage: RenderPage
defaultGetInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps>
defaultGetInitialProps(
ctx: DocumentContext,
options?: { nonce?: string }
): Promise<DocumentInitialProps>
}

export type DocumentInitialProps = RenderPageResult & {
Expand Down

0 comments on commit ffdb9f8

Please sign in to comment.