-
-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a417980
commit cf53378
Showing
4 changed files
with
28 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 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,12 +1,16 @@ | ||
import React from 'react'; | ||
import React, { lazy, Suspense } from 'react'; | ||
|
||
import { isAuthenticated } from '../../client/state/auth'; | ||
|
||
import Auth from '../templates/auth/Auth'; | ||
import Client from '../templates/client/Client'; | ||
const Auth = lazy(() => import('../templates/auth/Auth')); | ||
const Client = lazy(() => import('../templates/client/Client')); | ||
|
||
function App() { | ||
return isAuthenticated() ? <Client /> : <Auth />; | ||
return ( | ||
<Suspense fallback={<div />}> | ||
{ isAuthenticated() ? <Client /> : <Auth />} | ||
</Suspense> | ||
); | ||
} | ||
|
||
export default App; |
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