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
270d548d
Unverified
Commit
270d548d
authored
Jul 05, 2019
by
Joe Haddad
Committed by
GitHub
Jul 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove old docs (#7760)
* Remove old docs * Run doctoc
parent
6fa17b3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
38 deletions
+3
-38
README.md
packages/next/README.md
+3
-38
No files found.
packages/next/README.md
View file @
270d548d
...
...
@@ -53,7 +53,6 @@
-
[
With named exports
](
#with-named-exports
)
-
[
With Custom Loading Component
](
#with-custom-loading-component
)
-
[
With No SSR
](
#with-no-ssr
)
-
[
With Multiple Modules At Once
](
#with-multiple-modules-at-once
)
-
[
Custom `<App>`
](
#custom-app
)
-
[
Custom `<Document>`
](
#custom-document
)
-
[
Customizing `renderPage`
](
#customizing-renderpage
)
...
...
@@ -1175,7 +1174,7 @@ app.prepare().then(() => {
</ul>
</details>
Next.js supports
TC39 [dynamic import proposal
](https://github.com/tc39/proposal-dynamic-import) for JavaScript.
Next.js supports
ES2020 [dynamic `import()`
](https://github.com/tc39/proposal-dynamic-import) for JavaScript.
With that, you could import JavaScript modules (inc. React Components) dynamically and work with them.
You can think dynamic imports as another way to split your code into manageable chunks.
...
...
@@ -1239,9 +1238,7 @@ import dynamic from 'next/dynamic'
const DynamicComponentWithCustomLoading = dynamic(
() => import('../components/hello2'),
{
loading: () =>
<p>
...
</p>
,
}
{ loading: () =>
<p>
...
</p>
}
)
function Home() {
...
...
@@ -1264,9 +1261,7 @@ import dynamic from 'next/dynamic'
const DynamicComponentWithNoSSR = dynamic(
() => import('../components/hello3'),
{
ssr: false,
}
{ ssr: false }
)
function Home() {
...
...
@@ -1282,36 +1277,6 @@ function Home() {
export default Home
```
#### With Multiple Modules At Once
```
jsx
import dynamic from 'next/dynamic'
const HelloBundle = dynamic({
modules: () => {
const components = {
Hello1: () => import('../components/hello1'),
Hello2: () => import('../components/hello2'),
}
return components
},
render: (props, { Hello1, Hello2 }) => (
<div>
<h1>
{props.title}
</h1>
<Hello1
/>
<Hello2
/>
</div>
),
})
function DynamicBundle() {
return
<HelloBundle
title=
"Dynamic Bundle"
/>
}
export default DynamicBundle
```
### Custom `<App>`
<details>
...
...
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