Last active
July 12, 2017 14:17
-
-
Save notgiorgi/e2007e0b080f3e61e2e88c106a41af70 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // ./src/features/Posts/index.js | |
| // instead of directly exporting, we export wrapped | |
| export default withLazyLoading( | |
| () => import(/* webpackChunkName: "Post" */ './components/Post'), | |
| <Loading type="spinner" /> | |
| ) | |
| // ./src/views/News/index.jsx | |
| import Post from '...' | |
| /* ... */ | |
| class News extends React.Component { | |
| /* ... */ | |
| render() { | |
| /* ... */ | |
| <Post | |
| title={'Foobar'} | |
| {...} | |
| /> | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment