Skip to content

Instantly share code, notes, and snippets.

@themgoncalves
Created November 1, 2018 16:17
Show Gist options
  • Save themgoncalves/22d1bc71223f547e734e95433724f688 to your computer and use it in GitHub Desktop.
Save themgoncalves/22d1bc71223f547e734e95433724f688 to your computer and use it in GitHub Desktop.
React SSR components implementation demo
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