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
ec958a3b
Commit
ec958a3b
authored
Jun 28, 2019
by
Taro Shono
Committed by
JJ Kasper
Jun 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: default dynamic loading component to null (#7543)
parent
5e70a2f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
dynamic.tsx
packages/next-server/lib/dynamic.tsx
+2
-6
No files found.
packages/next-server/lib/dynamic.tsx
View file @
ec958a3b
...
@@ -66,10 +66,6 @@ export function noSSR<P = {}>(
...
@@ -66,10 +66,6 @@ export function noSSR<P = {}>(
)
)
}
}
function
DefaultLoading
()
{
return
null
}
// function dynamic<P = {}, O extends DynamicOptions>(options: O):
// function dynamic<P = {}, O extends DynamicOptions>(options: O):
export
default
function
dynamic
<
P
=
{}
>
(
export
default
function
dynamic
<
P
=
{}
>
(
...
@@ -83,7 +79,7 @@ export default function dynamic<P = {}>(
...
@@ -83,7 +79,7 @@ export default function dynamic<P = {}>(
if
(
!
pastDelay
)
return
null
if
(
!
pastDelay
)
return
null
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
if
(
isLoading
)
{
if
(
isLoading
)
{
return
<
DefaultLoading
/>
return
null
}
}
if
(
error
)
{
if
(
error
)
{
return
(
return
(
...
@@ -96,7 +92,7 @@ export default function dynamic<P = {}>(
...
@@ -96,7 +92,7 @@ export default function dynamic<P = {}>(
}
}
}
}
return
<
DefaultLoading
/>
return
null
},
},
}
}
...
...
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