Commit 8fb6f7d5 authored by Tim Neutkens's avatar Tim Neutkens

Use new import syntax in readme examples

parent 7f9d244d
......@@ -916,7 +916,7 @@ Here are a few ways to use dynamic imports.
```jsx
import dynamic from 'next/dynamic'
const DynamicComponent = dynamic(import('../components/hello'))
const DynamicComponent = dynamic(() => import('../components/hello'))
export default () => (
<div>
......@@ -932,7 +932,7 @@ export default () => (
```jsx
import dynamic from 'next/dynamic'
const DynamicComponentWithCustomLoading = dynamic(import('../components/hello2'), {
const DynamicComponentWithCustomLoading = dynamic(() => import('../components/hello2'), {
loading: () => <p>...</p>
})
......@@ -950,7 +950,7 @@ export default () => (
```jsx
import dynamic from 'next/dynamic'
const DynamicComponentWithNoSSR = dynamic(import('../components/hello3'), {
const DynamicComponentWithNoSSR = dynamic(() => import('../components/hello3'), {
ssr: false
})
......@@ -971,8 +971,8 @@ import dynamic from 'next/dynamic'
const HelloBundle = dynamic({
modules: () => {
const components = {
Hello1: import('../components/hello1'),
Hello2: import('../components/hello2')
Hello1: () => import('../components/hello1'),
Hello2: () => import('../components/hello2')
}
return components
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment