Created
November 1, 2018 16:17
-
-
Save themgoncalves/22d1bc71223f547e734e95433724f688 to your computer and use it in GitHub Desktop.
React SSR components implementation demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Loadable from 'react-loadable'; | |
const TitleAsync = Loadable({ | |
loader: () => import(/* webpackChunkName: "title" */'./title'), | |
loading() { | |
return <div>Loading...</div> | |
} | |
}); | |
const LoremIpsumAsync = Loadable({ | |
loader: () => import(/* webpackChunkName: "lorem-ipsum" */'./loremIpsum'), | |
loading() { | |
return <div>Loading...</div> | |
} | |
}); | |
export default function App() { | |
return ( | |
<React.Fragment> | |
<TitleAsync /> | |
<LoremIpsumAsync /> | |
</React.Fragment> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment