lordfrontend/src/App.js

27 lines
748 B
JavaScript
Raw Normal View History

2020-01-10 23:36:12 +00:00
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import React, { Suspense, lazy } from 'react';
const Home = lazy(() => import('./Home'));
2020-01-12 17:08:48 +00:00
const About = lazy(() => import('./About'));
const Notfound = lazy(() => import('./notfound'));
2019-12-27 22:33:58 +00:00
2020-01-10 19:10:59 +00:00
class App extends React.Component {
render() {
return (
2020-01-10 23:36:12 +00:00
<Router>
<Suspense fallback={<div>Loading...</div>}>
<Switch>
<Route exact path="/" component={Home}/>
2020-01-12 17:08:48 +00:00
<Route path="/About" component={About}/>
<Route component={Notfound} />
2020-01-10 23:36:12 +00:00
</Switch>
</Suspense>
</Router>
2020-01-10 19:10:59 +00:00
);
}
2019-12-27 22:33:58 +00:00
}
export default App;