Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
feat(routing): make all routes lazy
Browse files Browse the repository at this point in the history
feat(routing): make all routes lazy
  • Loading branch information
Metnew committed Oct 30, 2017
1 parent 143e5a4 commit d0a19c6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/common/routing/routes.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @flow
import {Route} from 'react-router-dom'
import RouteAuth from 'components/addons/RouteAuth'
import Dashboard from 'containers/Dashboard'
import Login from 'containers/Login'
// import Dashboard from 'containers/Dashboard'
// import Login from 'containers/Login'
import type {RouteItem} from 'types'

const loadLazyComponentFnConstructor = (url: string) => async () => {
Expand All @@ -24,8 +24,9 @@ const routes: Array<RouteItem> = [
icon: 'newspaper',
name: 'Dashboard',
sidebarVisible: true,
lazy: true,
tag: RouteAuth,
component: Dashboard
component: loadLazyComponentFnConstructor('Dashboard')
},
{
path: '/links',
Expand All @@ -47,8 +48,9 @@ const routes: Array<RouteItem> = [
{
path: '/auth',
name: 'Auth',
lazy: true,
tag: Route,
component: Login
component: loadLazyComponentFnConstructor('Login')
}
]

Expand Down

0 comments on commit d0a19c6

Please sign in to comment.