Commit 7fcd1ea7 authored by Arunoda Susiripala's avatar Arunoda Susiripala

Add async-reactor example.

parent 857a1d31
export default () => (
<p>Hello World 4 (imported dynamiclly) </p>
)
......@@ -9,6 +9,7 @@
"start": "next start"
},
"dependencies": {
"async-reactor": "^1.1.1",
"next": "*",
"react": "^15.4.2",
"react-dom": "^15.4.2"
......
......@@ -2,6 +2,7 @@ import React from 'react'
import Header from '../components/Header'
import Counter from '../components/Counter'
import dynamic from 'next/dynamic'
import { asyncReactor } from 'async-reactor'
const DynamicComponent = dynamic(import('../components/hello1'))
const DynamicComponentWithCustomLoading = dynamic(
......@@ -14,6 +15,10 @@ const DynamicComponentWithNoSSR = dynamic(
import('../components/hello3'),
{ ssr: false }
)
const DynamicComponentWithAsyncReactor = asyncReactor(async () => {
const Hello4 = await import('../components/hello4')
return (<Hello4 />)
})
export default () => (
<div>
......@@ -21,6 +26,7 @@ export default () => (
<DynamicComponent />
<DynamicComponentWithCustomLoading />
<DynamicComponentWithNoSSR />
<DynamicComponentWithAsyncReactor />
<p>HOME PAGE is here!</p>
<Counter />
</div>
......
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