|
1 | 1 | import React from 'react'
|
2 | | -import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom' |
| 2 | +import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom' |
3 | 3 |
|
4 | 4 | import '@/styles/app.scss'
|
5 | 5 |
|
6 | 6 | import { NavBar, Modal } from '@/components/shared'
|
7 | 7 | import { Home, Algorithms, About } from '@/pages'
|
8 | 8 |
|
9 | | -const App: React.FC = () => { |
10 | | - return ( |
11 | | - <div className='app'> |
12 | | - <Router> |
13 | | - <NavBar> |
14 | | - <Link to='/algorithms'>ALGORITHMS</Link> |
15 | | - <Link to='/about'>ABOUT</Link> |
16 | | - </NavBar> |
17 | | - <Modal /> |
18 | | - <Switch> |
19 | | - <Route exact path='/algorithms' component={Algorithms} /> |
20 | | - <Route exact path='/about' component={About} /> |
21 | | - <Route exact path='/' component={Home} /> |
22 | | - </Switch> |
23 | | - </Router> |
24 | | - </div> |
25 | | - ) |
26 | | -} |
| 9 | +const App: React.FC = () => ( |
| 10 | + <div className='app'> |
| 11 | + <Router> |
| 12 | + <NavBar> |
| 13 | + <Link to='/algorithms'>ALGORITHMS</Link> |
| 14 | + <Link to='/about'>ABOUT</Link> |
| 15 | + </NavBar> |
| 16 | + <Modal /> |
| 17 | + <Routes> |
| 18 | + <Route path='/algorithms' element={<Algorithms />} /> |
| 19 | + <Route path='/about' element={<About />} /> |
| 20 | + <Route path='/' element={<Home />} /> |
| 21 | + </Routes> |
| 22 | + </Router> |
| 23 | + </div> |
| 24 | +) |
27 | 25 |
|
28 | 26 | export default App
|
0 commit comments