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
68e3223c
Commit
68e3223c
authored
Jul 26, 2019
by
Adam Misiorny
Committed by
Luis Fernando Alvarez D
Jul 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve type definitions (#8117)
parent
8243af25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
utils.ts
packages/next-server/lib/utils.ts
+1
-1
index.d.ts
packages/next/types/index.d.ts
+3
-1
No files found.
packages/next-server/lib/utils.ts
View file @
68e3223c
...
...
@@ -215,7 +215,7 @@ export async function loadGetInitialProps<
C
extends
BaseContext
,
IP
=
{},
P
=
{}
>
(
Component
:
NextComponentType
<
C
,
IP
,
P
>
,
ctx
:
C
):
Promise
<
IP
|
null
>
{
>
(
Component
:
NextComponentType
<
C
,
IP
,
P
>
,
ctx
:
C
):
Promise
<
IP
>
{
if
(
process
.
env
.
NODE_ENV
!==
'production'
)
{
if
(
Component
.
prototype
&&
Component
.
prototype
.
getInitialProps
)
{
const
message
=
`"
${
getDisplayName
(
...
...
packages/next/types/index.d.ts
View file @
68e3223c
...
...
@@ -38,7 +38,9 @@ declare module 'react' {
* `Page` type, use it as a guide to create `pages`.
*/
export
type
NextPage
<
P
=
{},
IP
=
P
>
=
{
(
props
:
P
):
JSX
.
Element
(
props
:
P
):
JSX
.
Element
|
null
defaultProps
?:
Partial
<
P
>
displayName
?:
string
/**
* 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`.
...
...
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