Created
November 12, 2018 23:52
-
-
Save ger86/55f129326683bc9e2536a238eb26e5e9 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
import React, { PureComponent, Suspense, lazy, Fragment } from 'react'; | |
import { Route, Switch, HashRouter } from 'react-router-dom'; | |
import Loading from 'components/UI/Loading'; | |
const LoginScene = lazy(() => import('Scenes/auth/LoginScene')); | |
const ProfileScene = lazy(() => import('Scenes/user/ProfileScene')); | |
import { | |
loginRoute, | |
profileRoute | |
} from './routes'; | |
class App extends PureComponent { | |
render() { | |
return ( | |
<HashRouter> | |
<Suspense fallback={<Loading />}> | |
<Fragment> | |
<Switch> | |
<Route | |
path={loginRoute()} | |
component={<LoginScene />} | |
/> | |
<Route | |
path={userProfileRoute()} | |
component={<Profile />} | |
/> | |
</Switch> | |
</Fragment> | |
</Suspense> | |
</HashRouter> | |
); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment