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
f8317f15
Commit
f8317f15
authored
May 15, 2017
by
Arunoda Susiripala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an case to show when dynamic import components won't load.
parent
aeaccf44
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
hello5.js
examples/with-dynamic-import/components/hello5.js
+3
-0
index.js
examples/with-dynamic-import/pages/index.js
+10
-0
No files found.
examples/with-dynamic-import/components/hello5.js
0 → 100644
View file @
f8317f15
export
default
()
=>
(
<
p
>
Hello
World
5
(
imported
dynamiclly
)
<
/p
>
)
examples/with-dynamic-import/pages/index.js
View file @
f8317f15
...
@@ -20,6 +20,8 @@ const DynamicComponentWithAsyncReactor = asyncReactor(async () => {
...
@@ -20,6 +20,8 @@ const DynamicComponentWithAsyncReactor = asyncReactor(async () => {
return
(
<
Hello4
/>
)
return
(
<
Hello4
/>
)
})
})
const
DynamicComponent5
=
dynamic
(
import
(
'../components/hello5'
))
export
default
()
=>
(
export
default
()
=>
(
<
div
>
<
div
>
<
Header
/>
<
Header
/>
...
@@ -27,6 +29,14 @@ export default () => (
...
@@ -27,6 +29,14 @@ export default () => (
<
DynamicComponentWithCustomLoading
/>
<
DynamicComponentWithCustomLoading
/>
<
DynamicComponentWithNoSSR
/>
<
DynamicComponentWithNoSSR
/>
<
DynamicComponentWithAsyncReactor
/>
<
DynamicComponentWithAsyncReactor
/>
{
/*
Since DynamicComponent5 does not render in the client,
it won't get downloaded.
*/
}
{
React
.
noSuchField
===
true
?
<
DynamicComponent5
/>
:
null
}
<
p
>
HOME
PAGE
is
here
!<
/p
>
<
p
>
HOME
PAGE
is
here
!<
/p
>
<
Counter
/>
<
Counter
/>
<
/div
>
<
/div
>
...
...
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