Created
July 26, 2017 08:15
-
-
Save faceyspacey/3f7b778123a79ca339d181f5fdaab427 to your computer and use it in GitHub Desktop.
hash-based universal component (the old way)
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
| const components = { | |
| Home: universal(() => import('./Home'), { | |
| resolve: () => require.resolveWeak('./Home'), | |
| }), | |
| List: universal(() => import('./List'), { | |
| resolve: () => require.resolveWeak('./List'), | |
| }), | |
| Video: universal(() => import('./Video'), { | |
| resolve: () => require.resolveWeak('./Video'), | |
| }), | |
| } | |
| const UniversalComponent = ({ page }) => { | |
| const Component = components[page] | |
| return <Component /> | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment