Skip to content
This repository was archived by the owner on Jan 16, 2022. It is now read-only.

Commit 9c02cf7

Browse files
Merge branch 'master' into fix-tooltip-import
2 parents bd38995 + a365ec5 commit 9c02cf7

File tree

2 files changed

+5
-40
lines changed

2 files changed

+5
-40
lines changed

src/router.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ import { Router, Route, Switch } from 'react-router-dom';
55
import { createBrowserHistory } from 'history';
66
import { AppContextConsumer, AppStateInterface } from './App/App';
77

8-
import { asyncComponent } from './utils/asyncComponent';
98
import Header from './components/Header';
109

1110
const history = createBrowserHistory({
1211
basename: window.__VERDACCIO_BASENAME_UI_OPTIONS && window.__VERDACCIO_BASENAME_UI_OPTIONS.url_prefix,
1312
});
1413

15-
const NotFound = asyncComponent(() => import('./components/NotFound'));
16-
const VersionPackage = asyncComponent(() => import('./pages/Version'));
17-
const HomePage = asyncComponent(() => import('./pages/home'));
14+
const NotFound = React.lazy(() => import('./components/NotFound'));
15+
const VersionPackage = React.lazy(() => import('./pages/Version'));
16+
const HomePage = React.lazy(() => import('./pages/home'));
1817

1918
interface RouterAppProps {
2019
onLogout: () => void;
@@ -25,7 +24,7 @@ class RouterApp extends Component<RouterAppProps> {
2524
public render(): ReactElement<HTMLDivElement> {
2625
return (
2726
<Router history={history}>
28-
<>
27+
<React.Suspense fallback={null}>
2928
{this.renderHeader()}
3029
<Switch>
3130
<Route exact={true} path={'/'} render={this.renderHomePage} />
@@ -35,7 +34,7 @@ class RouterApp extends Component<RouterAppProps> {
3534
<Route exact={true} path={'/-/web/detail/@:scope/:package/v/:version'} render={this.renderVersionPage} />
3635
<Route component={NotFound} />
3736
</Switch>
38-
</>
37+
</React.Suspense>
3938
</Router>
4039
);
4140
}

src/utils/asyncComponent.tsx

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)