-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
React.lazy loads HyloEditorMobile and moves it above our routing setu…
…p allowing it to code-split with minimum dependencies
- Loading branch information
1 parent
62205c8
commit beafd50
Showing
4 changed files
with
17 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
import React from 'react' | ||
import React, { Suspense } from 'react' | ||
import ReactDOM from 'react-dom' | ||
import { rootDomId } from 'client/util' | ||
import App from './router' | ||
import Loading from 'components/Loading' | ||
|
||
import './client/websockets' | ||
import './css/global/index.scss' | ||
|
||
const App = React.lazy(() => import('./router')) | ||
const HyloEditorMobile = React.lazy(() => import('components/HyloEditor/HyloEditorMobile')) | ||
|
||
ReactDOM.render( | ||
<App />, | ||
window.location.pathname === '/hyloApp/editor' | ||
? ( | ||
<Suspense fallback={() => null}> | ||
<HyloEditorMobile /> | ||
</Suspense> | ||
) : ( | ||
<Suspense fallback={() => <Loading type='fullscreen' />}> | ||
<App /> | ||
</Suspense> | ||
), | ||
document.getElementById(rootDomId) | ||
) |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.