-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
123 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import * as React from 'react'; | ||
import { Routes, Route, Link } from 'react-router-dom'; | ||
import loadable from '@loadable/component'; | ||
|
||
const Home = loadable(() => import('./pages/Home'), { | ||
resolveComponent: (components) => components.Home, | ||
}); | ||
|
||
const About = loadable(() => import('./pages/About'), { | ||
resolveComponent: (components) => components.About, | ||
}); | ||
|
||
const App = () => { | ||
return ( | ||
<> | ||
<h1>React Router</h1> | ||
|
||
<nav> | ||
<Link to="/">Home</Link> | ||
<Link to="/about">About</Link> | ||
</nav> | ||
|
||
<Routes> | ||
<Route index element={<Home />} /> | ||
<Route path="about" element={<About />} /> | ||
<Route path="*" element={<NoMatch />} /> | ||
</Routes> | ||
</> | ||
); | ||
}; | ||
|
||
const NoMatch = () => { | ||
return <p>There's nothing here: 404!</p>; | ||
}; | ||
|
||
export default App; | ||
|
||
// import loadable from '@loadable/component'; | ||
|
||
// import * as ROUTES from '@/constants/routes'; | ||
// import { Page } from '@/components/Layout/Page'; | ||
|
||
// import { Navigation } from './Navigation'; | ||
|
||
// const ReviewKpis = loadable(() => import('./ReviewKpis'), { | ||
// resolveComponent: (components) => { | ||
// return components.ReviewKpis; | ||
// }, | ||
// }); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const About = () => { | ||
return ( | ||
<> | ||
<h2>About</h2> | ||
</> | ||
); | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const Home = () => { | ||
return ( | ||
<> | ||
<h2>Home</h2> | ||
</> | ||
); | ||
}; |