Created
March 10, 2017 13:49
-
-
Save happylinks/8110e3adca0f4ff6d23baee5dfdd1c4e to your computer and use it in GitHub Desktop.
async component compare
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
| // https://github.com/ctrlplusb/react-async-component | |
| const AsyncProduct = createAsyncComponent({ | |
| resolve: () => import('./MyComponent'), | |
| Loading: MyLoadingComponent, | |
| // No error component | |
| // No delay | |
| ssrMode: 'render', // default | |
| }); | |
| vs | |
| // https://github.com/thejameskyle/react-loadable | |
| const LoadableMyComponent = Loadable( | |
| () => import('./MyComponent'), | |
| MyLoadingComponent, | |
| MyErrorComponent, | |
| 200, // delay | |
| path.join(__dirname, './MyComponent') // ssr path | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment