Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. import React, { Suspense } from 'react';
  2. import { Router } from '@reach/router';
  3. import Loading from './Loading';
  4.  
  5. const Home = React.lazy(() => import('./Home'));
  6. const Dashboard = React.lazy(() => import('./Dashboard'));
  7. const Overview = React.lazy(() => import('./Overview'));
  8. const History = React.lazy(() => import('./History'));
  9. const NotFound = React.lazy(() => import('./NotFound'));
  10.  
  11. function App() {
  12. return (
  13. <div>
  14. <Suspense fallback={<Loading />}>
  15. <Router>
  16. <Home path="/" />
  17. <Dashboard path="dashboard">
  18. <Overview path="/" />
  19. <History path="/history" />
  20. </Dashboard>
  21. <NotFound default />
  22. </Router>
  23. </Suspense>
  24. </div>
  25. )
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement