Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
cc6eecd2
Commit
cc6eecd2
authored
Jun 04, 2019
by
Dmytro
Committed by
Luis Fernando Alvarez D
Jun 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to describe initial props in the NextPage type (#7491)
parent
725f8c2b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
index.d.ts
packages/next/types/index.d.ts
+2
-2
No files found.
packages/next/types/index.d.ts
View file @
cc6eecd2
...
@@ -27,14 +27,14 @@ declare module 'react' {
...
@@ -27,14 +27,14 @@ declare module 'react' {
/**
/**
* `Page` type, use it as a guide to create `pages`.
* `Page` type, use it as a guide to create `pages`.
*/
*/
export
type
NextPage
<
P
=
{}
>
=
{
export
type
NextPage
<
P
=
{}
,
IP
=
P
>
=
{
(
props
:
P
):
JSX
.
Element
(
props
:
P
):
JSX
.
Element
/**
/**
* Used for initial page load data population. Data returned from `getInitialProps` is serialized when server rendered.
* Used for initial page load data population. Data returned from `getInitialProps` is serialized when server rendered.
* Make sure to return plain `Object` without using `Date`, `Map`, `Set`.
* Make sure to return plain `Object` without using `Date`, `Map`, `Set`.
* @param ctx Context of `page`
* @param ctx Context of `page`
*/
*/
getInitialProps
?(
ctx
:
NextPageContext
):
Promise
<
P
>
getInitialProps
?(
ctx
:
NextPageContext
):
Promise
<
I
P
>
}
}
export
{
NextPageContext
,
NextComponentType
}
export
{
NextPageContext
,
NextComponentType
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment