1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Add an case to show when dynamic import components won't load.

This commit is contained in:
Arunoda Susiripala 2017-05-15 10:14:26 +05:30
parent aeaccf441b
commit f8317f158b
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,3 @@
export default () => (
<p>Hello World 5 (imported dynamiclly) </p>
)

View file

@ -20,6 +20,8 @@ const DynamicComponentWithAsyncReactor = asyncReactor(async () => {
return (<Hello4 />)
})
const DynamicComponent5 = dynamic(import('../components/hello5'))
export default () => (
<div>
<Header />
@ -27,6 +29,14 @@ export default () => (
<DynamicComponentWithCustomLoading />
<DynamicComponentWithNoSSR />
<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>
<Counter />
</div>